One of my main issue of making a game is like when you completed a level and then you died. If you try to do it again it just skips the level and you die again. I have that issue since Rocon Adventure
Example
it’s just stuck at the same position. Is there any code to fix this issue?
What does the code look like for hit detection?
this
I just rewatched the GIF and your character is in the same position as the exact time they died, so your character will always die no matter what.
You could reset his position after you restart the level, this shouldn’t be super hard but you have to memorize the X and Y positions.
I added some code but it just caused it to be stuck on the X and Y position.
You should move the first two lines of code in this script to the default script.
This code is currently in the update script, which means you will always be setting the x and y coordinates to the values shown in your code. This is what’s making it “stuck.”
If you move these lines to the default script though, the object will only move to that position when you enter the frame, which is what we want.
Thank you so much!