I have an object moving with a MoveBy action and during that movement I want to adjust it's y position, but keep the action running. I've tried adjusting the .position and I've tried using a new MoveBy with duration 0. In both attempts you see a single frame of the object y position adjusted to where I want it and the next frame the original move action overrides the new y position back to where it was. The only idea I have, I hope there is a better way and that is to stop the original action, adjust position, and then create a new action to complete what the first action was doing.
runing an action while another is already running
(5 posts) (5 voices)-
Posted 2 years ago #
-
I don't think you can run 2 actions that effect the same node properties at the same time. You might be better creating a step method and moving the sprite manually as you want yourself. Or possibly extent the MoveBy action to allow alterations (if thats possible).
Posted 2 years ago # -
Im not sure if this would help you, but maybe you could:
create a node "Container". Then create your Sprite "Character" and add it to "Container" at position (0,0). Now run your action on "Character" to move it around. And you can run a 2nd action on "Container" to move it vertically.
The action movements are added together, the 2nd action doesnt replace the 1st, so it may not be what you need.
Posted 2 years ago # -
I've been wondering for some time whether adding a new RepeatForever action to change a Sprite's animation will eliminiate any previous RepeatForever animation actions, or whether I have to keep a reference to my animation action and stop it manually before starting a new one? I've been using the latter method so far but would love it if I didn't have to.
Posted 2 years ago # -
I had the same problem and I have patched the JumpTo action to not touch the X position of the sprite, since I handle this on my own. Works quite well :)
Posted 2 years ago #
Reply
You must log in to post.