So, I have an object, it rotates by impulse and I need to know when it done full circle. Is there any easy way to do it?
I wouldn’t say this would be the best way, but one idea is just to accumulate the angular differences and check them. There is certainly a more direct way of calculating it if you extract all the variables, but my physics knowledge is rudimentary.
extends RigidBody2D func _ready(): prev_degrees = get_rotd() set_fixed_process(true) var rotated_degrees = 0.0 var prev_degrees func _fixed_process(delta): var curr_degrees = get_rotd() rotated_degrees += abs(abs(prev_degrees) - abs(curr_degrees)) if(rotated_degrees >= 360.0): print("360 rotation") rotated_degrees -= 360.0 prev_degrees = curr_degrees
I’ve done something very similar to your idea, but they both looks like ugly bicycle ); Although, it works, so, thanks for suggestion!
salomander86 | 2017-07-16 16:40