Hey, I feel like I’ve hit a wall now with this. I have a mock up of a solar system and I’m trying to create a puzzle where there are 4 levers and you have to align all the planets.
Lever 1 will rotate planets 1 3 5 7 by 45º.
Lever 2 will rotate planets 2 4 6 8 by 45º.
Lever 3 will rotate planets 1 2 3 4 by 90º.
Lever 4 will rotate planets 5 6 7 8 by 90º.
The only way I can think of it is if I have ‘Earth’ which is a static mesh component, get the world rotation, so e.g if it’s
x: 0 y:0 z:0 that is its starting point.
Then I need to get its Rotation.Z and add 45º to it. so it’ll rotate to x:0 y: 0 z: 45, then pulling the lever again will get its Rotation.Z and add another 45 to it making it x:0 y:0 z:90
The only problem with the way I’m doing it now is that because the Earth’s rotation is constantly updating, if I add +45 to it each time it’ll never stop rotating.
i might be understanding this completely wrong and not considering some Built-in functionality but wouldnt you have to solve this using mathematics? make the planets move on 2 axis, get the displacement angle and use Sine,Cos to calculate the new position? like i said…i think im understanding this wrong…
Would this not just get the initial Rotation Z on begin play and + 45 to it, so when I pull the lever the first time it’ll rotate Rinterp to ZTargetRot, but then not anymore because ZTargetRot doesn’t update to the current GetWorldRotation Z
I’m quite new to UE4 and Blueprints so don’t properly get everything yet. Here’s how my blueprint layout looks now if it helps.
Also included screenshots from in-game. First being when no levers are pressed, but all planets are spread out. Second screenshot being after I pull the lever, the planet rotates as expected but when I pull the lever again it doesn’t do anything.