Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: wallaceb68 on September 19, 2013, 01:32:15 PM

Title: reset an object
Post by: wallaceb68 on September 19, 2013, 01:32:15 PM
ok let me see if i can explain this.

i have an object with locomotion on it and a FSM
that FSM has several states that make the object do things.
one of the states plays just an animation.
what i need to know is how do i go from playing the animation back to a previous state with just locomotion on it? (beginning state)
every time i wire a transition back to the previous state it acts like it should(as far as moving and stuff) but is stuck in the animation position.(IE. not moving with locomotion) i have tryed stop animation, and it stop's the animation but doesnt reset it to the grounded pose.
 thanks
Title: Re: reset an object
Post by: Alex Chouls on September 19, 2013, 04:40:24 PM
Not sure I follow completely... did the animation move the character in a way that you want to reset? E.g., into the air, now you want the character back on the ground?

Does the previous state set a new animation to play? E.g., Idle.

Sorry, not picturing your setup yet... some screenshots or a screencast might help...
Title: Re: reset an object
Post by: wallaceb68 on September 19, 2013, 09:01:54 PM
Sorry about that, let me try agian.
i have a GameObject= a dog that has locomotion on it.
in playmaker FSM i have 4 states.
1st state the dog is just standing there waiting instruction. (button to "Lead")
with a transition "Next Area"
2nd state the dog is in "lead" with a smooth follow action (i can walk around and the dog goes with me walking with locomotion (button to "Guard"  with the transition "Next Area"
3rd state is the "play animation" the animation is the dog standing there barking ( i want him to stay in that one spot doing only that animation till i tell him to lead again.) with a button "Next Area" i what this button to take me back to the 2nd state of him in the "Lead" state.
i can get it to go back to that state but he is stuck in the "Guard" pose and locomotion isnt working.he will follow me but doesnt walk like he did in 2nd state. thanks again alex for all your help.
Title: Re: reset an object
Post by: Alex Chouls on September 19, 2013, 09:06:23 PM
I assume the second state has a Play Animation action to start the walk animation?

Can you post a screenshot of the actions on the second state?
Title: Re: reset an object
Post by: wallaceb68 on September 19, 2013, 09:33:52 PM
State1
Title: Re: reset an object
Post by: wallaceb68 on September 19, 2013, 09:34:29 PM
State2
Title: Re: reset an object
Post by: wallaceb68 on September 19, 2013, 09:35:00 PM
state3
Title: Re: reset an object
Post by: wallaceb68 on September 19, 2013, 09:35:30 PM
state4
Title: Re: reset an object
Post by: wallaceb68 on September 19, 2013, 09:37:06 PM
alex no the only state with animation is the last one. it walks with locomotion. sorry i couldnt figure out how to post the pics in the screen.
Title: Re: reset an object
Post by: jeanfabre on September 20, 2013, 02:52:30 AM
Hi,

 you seem to have missing actions and errors on states. You need to correct that before  testing if animation works.

to post pics, you need to host them online, for example using dropbox or your web server if you have one.


bye,

 Jean
Title: Re: reset an object
Post by: wallaceb68 on September 20, 2013, 08:18:09 AM
Jean, the animation works fine, getting out of the animation is my problem. i'm going from a gameobject controlled by locomotion to animation back to locomotion control. i just cant get it to leave animation for locomotion control thats why the errors are there. i'm trying different things. thanks
Title: Re: reset an object
Post by: wallaceb68 on September 20, 2013, 09:05:18 AM
ok i have it working somewhat. in state 5 i put a "Create Object" followed by a "Destroy Self" which resets the object as a "Clone". it just seems to me that there should be a action to RETURN TO "A" PREVIOUS STATE not just RETURN "TO" PREVIOUS STATE.
Title: Re: reset an object
Post by: Alex Chouls on September 20, 2013, 09:30:59 AM
What is the "locomotion control"? Is it a script?

It sounds like you have multiple scripts controlling the game object.

What is setting the locomotion animation in the first place?
Title: Re: reset an object
Post by: wallaceb68 on September 20, 2013, 09:49:24 AM
alex the locomotion is controlled by the "character controller" in the inspector window. the dog is controlled by the "smooth follow" and the "itween move to_v2"
so when the dog is told to follow a path or smooth follow the player the object will move on that path and the "character controller" will move his legs so it looks like he is walking as he goes on the path.
Title: Re: reset an object
Post by: Alex Chouls on September 20, 2013, 10:32:52 AM
So where are you setting the walking animation? Is it the default animation in the Animation component? Can you just not use Play Animation in State 2 to play the walk animation?
Title: Re: reset an object
Post by: wallaceb68 on September 20, 2013, 10:50:25 AM
alex you set the walking/running animation in the locomotion/leg controller(script).
it is based off the speed the object is going,(slow is walking, fast it will run)
i need the play animation for what i have dog doing. i have no way to control his mouth (for barking) without it. sometimes it will have it's feet up on something barking up (which is another animation) or half way up on a vehicle's trunk barking.
Title: Re: reset an object
Post by: Alex Chouls on September 20, 2013, 11:41:43 AM
Can you post the locomotion script? After you change the animation on the object (e.g., bark) you probably need to set it back to the animations the locomotion script is expecting. Going to a state in Playmaker doesn't reset any state outside of Playmaker (e.g., other scripts, animation components etc.)

You could look at the animation component before you play your animation and set it back to that when you return to the locomotion state. But it's hard to say without looking at the locomotion script...
Title: Re: reset an object
Post by: wallaceb68 on September 20, 2013, 01:38:23 PM
(http://Screenshot 2013-09-20 12.36.05.png)
Title: Re: reset an object
Post by: wallaceb68 on September 20, 2013, 01:48:41 PM
try this alex. you see where you have to enter a name for the motion group under "leg controller" i wonder how i could call on this group with playmaker?
crap it wont let me add a screen shot, it say file too big, but i see people do it all the time!!
Title: Re: reset an object
Post by: Alex Chouls on September 20, 2013, 02:03:01 PM
What format is the image? Try a jpeg.
Title: Re: reset an object
Post by: wallaceb68 on September 20, 2013, 02:22:44 PM
it is in dropbox