I'm working on an on-rails-shooter using the current 3.1 beta, where one of the manoeuvres has the player ship rotate on itself (like a barrel-roll). I can get it to rotate around itself, but it doesn't quite work as planned. This is what it currently looks like in action
Notably: the ship does a full 360* reverse roll back to the 0 position, instead of completing a roll from 270*, or going back to 0 after breaching the initial rotation . Is there a way to force a 360* rotation to be seen as going back to 0 upon going a bit above?
I tried doing something along the lines of this question, but it doesn't work with what I have.
Here's the current code that I'm using for the effect:
var angles = Vector3()
> tilt += tilt_lr * TILT_SPEED
>> if roll:
>>> tilt += tilt_lr * ROLL_SPEED
if abs(rotation_degrees.z) >= ROLL_SPEED
> tilt += tilt_lr * 0.0
var flight_dir = Vector3(pitch,yaw,tilt)
angles = angles.linear_interpolate( flight_dir, ROTATE_SPEED * dt )