0 votes

A rigidbody projectile comes out of the center of a kinematic body, is there any way to make the projectile ignore the kinematic body so it can have a predictable trajectory but once it has been shot still interacts with the kinematic body?

I could use a physics mask but that would make them never interact even after the projectile has been fired, and I don't know how it would behave with other players using the same player tscn file.

in Engine by (52 points)

1 Answer

0 votes

Do you want the bullet to harm the player that shoots it? If you're just concerned with it ignoring the shooter but still colliding with other players, try using add_collision_exception_with():

https://docs.godotengine.org/en/3.2/classes/class_physicsbody.html#class-physicsbody-method-add-collision-exception-with

by (20,923 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 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.