samedi 23 octobre 2021

Rotate self between an arc on the local axis Godot

I have a node which fires a bullet, but I want to randomly rotate it a little so that certain guns are unpredictable. Specifically, I want to rotate it on the X and Y axes between a -2.5 - 2.5 degree arc on the local axis. I've tried rotation.x = rand_range(-2.5, 2.5 * PI) and rotation.y = rand_range(-2.5, 2.5 * PI), but these seem to rotate the node on the global X and Y axes. How should I rotate the bullet emitter node locally between an arc? Thank you in advance.




Aucun commentaire:

Enregistrer un commentaire