I have make a snail which goes in shell when collide with player falling or collision with bullet. and when it goes to shell it waits six seconds and become normal.But after then collision with bullet and player falling doent work
I think its because you are rapidly resetting the timer here
I guess you should keep it in a child event with trigger once condition
An event inside another means it is a child event of the event it is in.
How about i send u a file and u check it? plz
No, we don’t need to do that, I think you didn’t understand, but what I said is this
Make a child event like this and then reset the timer
The problem is that the timer isn’t stopped and reset once it gets to 6 seconds.
@ChaudharySaboor, A couple of things:
- You need to change the timer to an object timer on the SnailEnemy. Otherwise the timer for all snails is started again once a snail is jumped on or shot at.
- You need to reset and pause the timer when the snail changes from in shell to out of shell. As it stands, you aren’t resetting and stopping the timers, so as a result the event
The timer "Snail is greater than 6 secondskeeps firing every frame once the timer is more that 6 second. This means the SnailEnemy is always getting set to the move animation.
I havent reset timer as it reaches six secnd thanks all.
u guys r damn talented
Use object timers. Otherwise you could end up with this scenario:
SnailEnemy is jumped on, timer reset to 0.
another SnailEnemy is jumped on. Timer is reset to 0
nothing happens - timer is now at 1 second
another SnailEnemy is jumped on. Timer is again reset to 0
finally all 3 snails come out of their shells at the same time.
I don’t think this is what you want to happen.
Now only one snail go back to walking . the remaining on shell state?! When i hit them
Like @MrMen suggested, are you using Object Timers?
Actually i m beginner and i dk what object timer are!
Oh so it is a timer of a specified sprite?
According to gdevelop wiki
object timers are timers of Objects and what you are using is scene timer.
Yes, I think not only sprite but all other objects
Ok lemme try!!! and i will tell u
Ok so now the all walk but they do at the same time
for example the animation of all are changed to walk at same time while they were down at different times
An object timer is just a timer that linked to an object (sprites are the usual cases where they’re used). You can have the same named timer on different objects, and they’re all treated as different timers.
Sheesh, did you even take in what I wrote?
But then some of them will take alot of time if i have many snails!
Eh? No, not if you use object timers. Read the first part of my previous response.
That scenario is if you don’t use object timers