Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | DodoIta | |
Old Version | Published before Godot 3 was released. |
I have a shield and an enemy who shoots bullets towards the shield and both shield and bullets are KinematicBody2D-type located in separated scenes.
I want the bullet to be deflected once it hits the shield but I don’t know how to do that since it belongs to a different scene.
I tried something like this in the shield’s scene but it doesn’t seem to work:
func _fixed_process(delta):
if(is_colliding()):
var entity = get_collider()
var normal = get_collision_normal()
entity.move(normal * entity.speed * delta)
What’s wrong here?