I have an object plantturret that rotates 22.5 degree increments depending on the players position and an object plant with frames of animation that correspond to the rotation of plantturret but I can’t work out the syntax to make the animation frames of plant go forward or backward when plantuttet rotates? for example when rotation increases 22.5 degrees clockwise add 1 frame when decreases anticlockwise subtract a frame each time.
I don’t understand how to add that into the events? the plant has an animation with 9 frames and plantturret rotates no animation. when the planturret rotates in increments of 22.5 degrees the plant object should go to the next frame each increment.
ok I see now this works but the animation is opposite direction to plantturret thanks for your help I didn’t know the syntax I will try to work out the directions
thanks for your help I’m really stuck and can’t get the animation to align with the rotation. I have uploaded json file you can see what I’m trying to do but the animation is off possibly has to do with the rotation being 270 degrees? plant animation uses 7 frames half the radius then flip plant for the opposite half?
I’ve had a look at you project. For the plant animation, you’ve got the same image for each frame, just rotated around a bit. If that’s all you’re doing with the image, why not just use the plantturret’s rotation and have only one frame for the plant’s animation?
I’m working on a solution. Bear with me (if someone else doesn’t manage to work it out before me). It’s a tad tricky because the angles go from 45 to -180, and then from 180 to 135 and the change isn’t in the middle of the rotation.
I’m now having a problem when adding multiple instances of plantturret and plant because plantturret is at different positions to the player but plant frames are set to the initial plantturret. I tired for each object and also changing the scene variable to object variable but that didn’t work