Page 1 of 1
Animation not working with OnEnterRegion [Solved]
Posted: Tue Jan 03, 2017 1:35 am
by SkinnyODST
I made a region, called it "testfly" and made an animation called "testflight" that goes for 10 seconds. I unticked "Play when level starts" and everything is named right in ZE and the LUA, but nothing I do seems to trigger it when I enter the testfly region.
I`ve tried -
and
Re: Animation not working with OnEnterRegion
Posted: Tue Jan 03, 2017 1:38 am
by AnthonyBF2
Try:
Code: Select all
ActivateRegion("testfly")
testfunction = OnEnterRegion(
function(region, player)
if IsCharacterHuman (player) and IsCharacterInRegion(region) then
PlayAnimation("testflight")
end
end,
"testfly"
)
You could also try
character inside the bit I added, not sure which one would make it work if that works
Re: Animation not working with OnEnterRegion
Posted: Tue Jan 03, 2017 10:52 pm
by SkinnyODST
Still nothing
Re: Animation not working with OnEnterRegion
Posted: Wed Jan 04, 2017 5:18 pm
by Marth8880
Did you also remember to check "Disable Hierarchies"? These are the settings your animation group should use:
Also, "testflight" is the name of the
animation group, not the
animation, right?
Oh, and what's the ClassLabel of the object are you trying to animate? This is found at the very top of the object's ODF. If you don't see it but you do see ClassParent, open up the ClassParent ODF and check that ODF's ClassLabel.
Re: Animation not working with OnEnterRegion
Posted: Wed Jan 04, 2017 8:57 pm
by SkinnyODST
The animation group is called "testflying" and the object I`m animating is a droid gunship I turned into a prop. It`s an armedbuilding
Here`s the entire ODF -
Re: Animation not working with OnEnterRegion
Posted: Wed Jan 04, 2017 9:08 pm
by Marth8880
SkinnyODST wrote:The animation group is called "testflying"
Then that's what you need to pass into the first argument of PlayAnimation (or whichever function you end up using). You can only play animation groups, not standalone animations. The standalone animation that you create is just a set of keyframes, it doesn't determine which props are animated or anything - that's all set up in the animation group.
[color=#FFFFFF]procedural animation mode.doc[/color] wrote:
PlayAnimation("Animation Group Name")
Resumes playing of an animation group from whichever time it was at last.
PauseAnimation("Animation Group Name")
Pauses the group’s playback – objects remain where they are currently.
RewindAnimation("Animation Group Name")
Rewinds the group to the beginning. Can be called while the group is playing. If called while the group is stopped, play will resume from the beginning when Play is called.
PlayAnimationFromTo("Animation Group Name", beginTime, endTime)
beginTime and endTime are floating-point numbers, in seconds. Plays the indicated animation from beginTime to endTime. So for a 10-second animation, playing from 0 to 5 plays the first half, and playing from 5 to 10 plays the second half. See “Animation Start Points” below for more information.
SetAnimationStartPoint("Animation Group Name")
Takes the current positions of the objects referenced by the group, and uses those positions as the new start point for when that object is next animated.
Re: Animation not working with OnEnterRegion
Posted: Mon Jan 09, 2017 12:37 am
by SkinnyODST
Marth, you are amazing! This ENTIRE time I thought I had to put in the name of the animation, not the group. Now that I can do this, things are gonna get epic! Thank you sooooo much!
And sorry for a late reply, I was having a break from modding and playing Xbox instead
