View Single Post
# 2 21-09-2007 , 05:44 PM
t1ck135's Avatar
Registered User
Join Date: May 2004
Location: UK
Posts: 1,991
Dont despair, its only missing some extra descriptions user added image

Gun - looks to be the group that contains all the barrel elements. Make sure you have the group selected (or create a group for it) and rename it to 'Gun'
Locator - appears to be named 'Aim_Locator' so make sure it is named that

The expression needs to be assigned to the gun group so make sure that is selected when you open the expression editor. It should be listed in the left column so you can select the rotateY attribute in the right column and then copy and paste the code in and create the expression.

I've attached an example maya file with it broken down into this area. In it there is the aim locator with the Firing attribute keyframed to 5 on frame 0 and keyframed to 0 on frame 100. There is a barrel with two instances in a group called Gun. If you rewind and run the animation then the Gun group barrels start spinning immediately as the Firing attribute is 5 and it gradually slows down and stops on frame 100 as the firing attribute is set to 0.
Play about with keying the Firing attribute in the locator and you will be able to change when the gun barrels rotate etc.
Hope this helps user added image

Si

p.s, the file is saved as a Maya 7 file so if you have an earlier version and it doesnt open, simply open it in notepad and change the 7.0 bits to whatever your version is user added image

Attached Files
File Type: ma gun_rotate.ma (61.9 KB, 459 views)

Examples of bTraffic - a traffic animation tool for Maya
bFlocking - a tool for Maya 8.5+ to generate flocking and swarming behaviours
Jan/Feb Challenge 2007 Entry and W.I.P
May/Jun Challenge 2006 Entry and W.I.P
Mar/Apr Challenge 2006 Entry and W.I.P
Jan/Feb Challenge 2006 Entry and W.I.P
Nov/Dec Challenge 2005 Entry and W.I.P
Sep/Oct Challenge 2005 Entry and W.I.P
Jul/Aug Challenge 2005 Entry
www.flash-fx.net