I am trying to make a brotato type game and the raycast on the gun only registers its hitting something when im shooting the enemy from a specific angle. I included a picture to display the angle.
I don’t think it’s the rotation, is the orange line a drawing? Try playing with visible collision shapes on. To turn it on go to the “Debug” menu
I’ve seen this a lot, is there a particular tutorial telling people to use this line? It’s totally unnecessary. You can get the current node with self or nothing, it implicitly looks in the node’s properties and methods automatically.
# all three of these lines are the same
# you should prefer the last two for performance
if gun.rotation_degrees > 90:
if self.rotation_degrees > 90:
if rotation_degrees > 90:
I turned on visible collisions and the raycast only appears when im pointing at my self. if the gun is not aiming at the player and the ray is not touching the player than the ray goes away