0 votes

how to check who collide with object in moveandslide?
like if i want check who i collide with in moveandcollide , i can just do like this moveandcollide(motion).collider. but i dont know how to do it with moveandslide.

and why moveandslide didn't need *delta?

var right = Input.is_action_pressed("ui_right")
var left = Input.is_action_pressed("ui_left")
var up = Input.is_action_pressed("ui_up")
var down = Input.is_action_pressed("ui_down")

movement.x = int(right) - int(left)
movement.y = int(down) - int(up)

var motion = movement.normalized()*move_speed*delta

var collision = move_and_collide(motion)
if collision:
    var collider = collision.collider
    if collider.is_in_group("wall"):
    if collider.name == "enemy":
        if scale <= Vector2(10,10):
            scale += Vector2(1,1)
            scale = Vector2(1,1)
in Engine by (393 points)

Please log in or register to answer this question.

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 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 webmaster@godotengine.org with your username.