0 votes

So, I have 2 player objects that are both CollisionShape2Ds. When one player jumps on the head of another player, I'd like to reset the position of the player who got stomped but not the position of the player that did the stomp. However when I change the position of one of the player objects, I believe it applies the position change to the other object as well due to them being in a collision state. What is the best way to achieve this in godot?

in Engine by (12 points)

1 Answer

+1 vote

func physicsprocess(delta):

if is_on_ceiling():
set_position(Wherever you want the spawnpoint to be)

if is_on_floor():
print("Killing is free")

I believe this will only work for KinematicBody2D/KinematicBody
tho I'd still recommend, checking what they collided with

by (408 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.