Hi, i am making a platformer game. My pc isn’t the greatest so maybe it’s one of the problems. I have a teleport stick mechanic. You throw the stick with m and you teleport to it with n. You have a cooldown and when it’s empty you can’t throw the stick. The problem comes when u wanna teleport to it. You teleport to it normally, but then when you are in the stick it kinda does some weird collision. It doesen’t break the game that much but it can be a problem when you are doing tight teleport jumps. You teleport to it while it is moving and it kinda teleport’s you at the right place but then u get teleported a bit back. Is it normal for gdevelop to be like that or i messed up the code? (I used when n key pressed put an object around another 0 angle and 0 pixel distance). Thanks for the help!
does your stick rotate?
if so, make sure that the origin point of your stick is at the center.
It doesen’t rotate. It’s get’s under the floor sometimes so i just made it not rotate. Hitbox is only around the stick
I also found out the game freezes when i press n to teleport to the stick but there isn’t any thrown sticks.
you need to check if there is a valid target to teleport to first then.
show a screenshot of your events.
you dont use seperate 2 objects for player/stick?
Player is one object with a platform charachter behavior and the stick is just a new object with no behaviours
Instead of using put object around another, set the position of player to stick.X () stick.Y ()
Also consider a trigger on under the m key is pressed
Changed it, still has that a bit of glitchiness, i guess it will just need to stay. But how do i make it so the game doesen’t freeze when i press n to teleport but no sticks have been thrown?
is the origin of your player in the center?
you can do this:
if m key is pressed:
->number of timer objects > 0
->-> animation of timer=0
->->-> player is flipped // Do your actions. change position of player to stick should also be here.
I don’t understand, Sorry im new to proggraming. The camera follows player with code (Center camera on Player)
the center point of your sprite.
of both your stick and the player do have the origin in center position, there shouldnt be any flickering.
What do i do with the red point?
put the red point in the middle of your sprites.
with mathematical precision, not dragged per hand