Actor stops after collision
mxs2649
Member Posts: 32
"I am moving a rectangle actor diagonally on the screen within a limited y value, it moves only when a "moved" attribute is false. As soon as my other circle actor touches rectangle actor, the moved attribute is true and the rectangle stops moving diagonally, instead it comes down 100 px using the moveTo attribute and once it comes down, i am setting the moved to false again after 0.07 seconds. But it does not starts moving again. Why?" I have been asking this question for some time now and tested some solutions but it is not working...any help is appreciated. Thanks
Comments
Upload a test project and someone will have a look at it. Compress it before you try and upload it or it won't be accepted.
Universal Binary Template - Universal Binary Template Instructions Rev 4 (Short) - Custom Score Display Template
https://dropbox.com/sh/fnp8i0x2b9hjdqv/AADvXPs_1_GLDdGTHXIdyhG5a
I have attached my project link for dropbox. My actor when touches the green rectangle which is moving diagonally, the green box moves down at a particular position and then it should again start moving but it does not. It moves diagonally when a attribute game.moved is false. When the rectangle actor touches the green one, it moves below and game.moved is true. After 0.07 seconds..game.moved is false again but the green actor does not start moving diagonally again. How should i fix this?
Please help, I am stuck on this from quite some time now.
Hi @colander
I have attached my project here, can u please help.
[merged threads]
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I have a feeling the problem is with the MoveTo behaviors. They act as interpolations of the actor's position so changing the speed while that's occuring is going to have unpredictable results. That's my guess, anyway. I tried turning them off and it worked a bit differently.
Also, if you use a Log Debugging Statement in a few places, you can see that the X velocity is 0 and the Y velocity is -100 when game.Moved is changed back to false. I'm not sure why...
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Also, I find this quite confusing:
Can you explain without the behaviors, rules and timers how you want the game to function? For example, you might say "when the green box collides with the rectangle, it should move down for a little while, stop, and then continue moving diagonally as before." Or can you give us a bigger picture of what this game is about? Sometimes having that context is really helpful. For example, maybe you're making Q-Bert or a Track and Field game... if we know that those are supposed to be javelins that fall or whatever, it gives us perspective. Because right now I'm completely lost.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Hi @tatiang, thanks for replying. The blue rectangle will be an actor jumping and going up and the green rectangle will be different types of platforms with different movements. So basically the actor will jump and reach on platform and jump again..thts what i have in my mind. I have all different types of actors moving horizontally and vertically..like for the horizontal one i make them move left to right or right to left when their "y" velocity is 0. So when the actor jumps on a platform, it moves down and when it stops the "y" velocity becomes 0 and thus it starts moving again horizontally. But i cannot use this technique with diagonal movement because all the time both x and y velocities are being used. I know what you are saying about the moveTo behavior and that is what i want..a solution for it. Thank so much for helping me.
Okay, that makes a lot more sense now.
I'll think about a solution... meanwhile someone else may have a good idea, too.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thank you so much, i tried to make it work by changing friction, drag or anything very little so that it does not affect the movement much but does the job for me but again the same thing i guess. Even if you change the value of game.moved to false after like after 7-8 seconds when the platform has stopped coming down, even then it does not starts moving again. There should be a way to start the set of rules again or like refresh, like calling a function in traditional coding to make this happen. Thanks again and yes i really hope someone does.
Anyone...something?
@tatiang Hey did u find a way yet?