I am using v1.19.3
I don’t know how to make it that if you touch something, you die and respawn.
I really need help and I will give credit to anyone who helps
I am using v1.19.3
I don’t know how to make it that if you touch something, you die and respawn.
I really need help and I will give credit to anyone who helps
Hi you can use the hits() function.
The usage is simply: if (this.hits(something) { // run code }
for the death and respawn, you can make it so if it hits an object that kills the player, its position will move to somewhere away from the project.
for example (On the Update script)
if (this.hits(killBlock)) {
// death screen optional
this.x = 0; // the respawn position
}
Let me know if you have questions. I currently don’t have much time to write right know but i will tommorrow.
Thank you so much!
If you have itch.io, tell me your user so I can give you credit, if you don’t have itch.io I’ll just use your wick editor user.
depending on the type of the game and sprite shape and number it may also be used a simple relative distance between objects instead of hit test. way faster