|
Post by commended on Feb 15, 2017 21:37:05 GMT
The title explains it all, I want the skinmesh to pause the animation when it doesn't move, I can't use input commands since the gameplay runs off path finder, I just need it so that when the skinmesh is at 0mph the animation shall freeze then resume once the speed is picked up.
|
|
|
Post by kulu on Feb 16, 2017 9:50:00 GMT
check out the "character demo " in the sample projects. I think thats where you will find your solution. or you can use the "switch" object, which switches between two animation sets when the 'Switch" object is started by another object like " event on input" . you will have to add an idle animation to your skinmesh , and alternate between walking and idle .
|
|
|
Post by commended on Feb 16, 2017 10:22:48 GMT
kulu Well, the problem with this is is that the character is controlled by the path finder (basically you click where you want to walk), much like a game such as league of legends. So there is no event on input that is released, therefore the character would not know when to stop the animation. So I need it to only play when the character is moving.
|
|
|
Post by kulu on Feb 16, 2017 11:47:19 GMT
Okay . i havent worked with path finder much. but i know that the script in the "character demo" can be specified to play an animation if the speed of the object is more than 0 . so in theory, anything under zero will not play any animation. its also worth noting that , the skinmesh's default animation (in the skinmesh options panel) should be the idle animation.
|
|
|
Post by GH Games on Feb 16, 2017 12:12:21 GMT
This Script:
int AnimationSet = 0; int AnimationSetNew = 0; void Main() { if (iInitializing()) { AnimationSet = 2; AnimationSetNew = AnimationSet; } else { if (IN_0 > 0.2) { AnimationSetNew = 0; //walk //set SkinMesh's walk animation speed based on //current SkinMesh object's translation speed OUT_1 = iFloatInterpolate(IN_0,0.2,50,0,50,true); } else { AnimationSetNew = 2; //wave OUT_1 = 1; }
//set current animation set for the SkinMesh object, //but only if it is different than the one currently //playing. We need to avoid resetting the animation //at every script loop, for performance reasons. if (AnimationSetNew != AnimationSet) { AnimationSet = AnimationSetNew; OUT_2 = AnimationSet; } } }
Taken from the "Character demo" does what your looking for. When the SkinMesh is moving the walking animation plays, when it isn't moving the wave animation plays. All you need to do is edit the AnimationSet and AnimationSetNew to your SkinMeshes animations. Even using the path finder this should work.
|
|
|
Post by commended on Feb 16, 2017 12:45:38 GMT
Thank you GH Games for providing me with the script (btw, your tutorials are great, very helpful) and thank you kulu for helping me understand the way it works. Would any of you know how to make the animation slower though. At the moment the walk animation is about 5 times to fast considering the walk speed.
|
|
|
Post by GH Games on Feb 16, 2017 13:32:07 GMT
Thank you very much and yea you can change the animation speed by using OUT_1 (or whatever OUT it is for you). Set it to something like: OUT_X = 0.5; //Half Speed or if it's 5x faster as you say then maybe: OUT_X = 0.1; //As fast as a tortoise lol Give that a whirl bro
|
|
|
Post by commended on Feb 16, 2017 14:56:49 GMT
GH Games Thank you very much. I can finally begin my second level
|
|
|
Post by GH Games on Feb 16, 2017 16:50:19 GMT
No worries I'm glad to have helped it's what we're all here for Good luck with your game bro
|
|
|
Post by commended on Feb 17, 2017 9:30:11 GMT
|
|