Good Morning… sorry my english!!
how do a Player turn a demon when take a coin and come back to normal in 5 seconds??
the way that i doing… the player come back normal quickly!!
THANKSSSSS!!!
Good Morning… sorry my english!!
how do a Player turn a demon when take a coin and come back to normal in 5 seconds??
the way that i doing… the player come back normal quickly!!
THANKSSSSS!!!
Add a timer and when the player is in collision with coin, reset the timer and change the player to demon. Then, check if the timer value is greater than 5 second, If yes, turn the demon back to player
thanksss!!! sorry i begin in gdevelop today!! can you should explain better???
Timers are what they sound like. You can use it to make a delay between something happening. There are two types of timer you can choose from scene timer and object timer. Scene timer should be fine for your need. You can learn more here: Timers [GDevelop wiki]
So here is the psedo code:
Player is in collision with coin: delete coin, set animation of Player to “IdleDemon”, reset (Start) scene timer “NameOfTheTimer”
Scene timer “NameOfTheTimer” = 5: set the animation to “NameOfTheAnimation”, Pause scene timer “NameOfTheTimer”
You have to change the animation back to what you want after the timer is greater than 5 seconds. Currently, you are changing it to the same animation
As Midhil says when the timer reach 5 just change the Player animation to Idle instead of IdleDemon and for a better performance add Trigger Once on the Player collision with Coin, and another Trigger Once on the Timer is greater than 5 seconds Like.
Player is in collision with Coin
Trigger Once
This way
The timer “TimerDemon” is greater than 5 seconds
Trigger Once
Plus you can Delete the timer when the time is greater than 5 seconds
Delete timer “TimerDemon”
work!! i remove the lines above!! thanks!! man!!! SET ANIMATION IDLE E JUMPING