Want to make my main actor get "frozen" for "x" seconds after colliding with another certain actor
nicksoldo14
Member Posts: 2
pretty much have items falling from the sky and one of the items i want to freeze my character in place for "x" seconds when they collide. i thought i was getting close but couldnt exactly figure it out. thanks
Comments
@nicksoldo14 Welcome!
Do you want the character to continue at its original speed and direction after the freeze is over?
Also, please be a bit more specific with what you are having problems with. The Rule, stopping the character or making it continue?
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
yeah i want him to continue at his original speed and direction. I just couldnt figure out the rule to make an incoming actor stun/freeze my main actor for a second and then unfreeze after the second and have my main actor continue what he was doing.
@nicksoldo14
Probably helps to @ people you are replying to so they can see it easier.
As for the issue, I feel this could help to explain a little about how the main actor moves. Like is it a key press, touch? Or does the main actor move automatically?
The simple function for making a freeze to make the main actor stop when collided with the actor is to use a custom boolean attribute under the actor attributes. You can set the movement rule with an attribute condition saying if self.freeze is false then movement happens.
Then have another rule saying actor collides or overrides with incoming actor, then sets self.freeze to true as well as having a timer saying after so many seconds you want the freeze to happen for, then turn self.freeze off.
When player collides with enemy
For 2 seconds
constrain self.motion.linearvelocity.Y to 0