i have a tower and in the towers exterior there are gears that are suppose to be turning. i was messing with the blue prints but i cant seem to figure out how to make a looping animation. i want them to rotate for as long as one is in play mode. how to i accomplish this?
Here’s an approach that offers control over rotation speed, rotation axis, and starting/stopping, as well as going perpetually until you stop it.
Right click and create a Timeline. Double click the node to go into its editor. These little guys are pretty amazing.
For this example, I set the Timeline to have a length of 1 second, as seen at the top. You can adjust this however you like and it will adjust the speed of your rotation.
Create a float track by hitting the f+ button at the top. You’ll need to add “keys” by right clicking. It sets a point at a time and a value, creating a graph line. You can add as many keys as you like.
For this example, I set a key at 0,0 and 1,1. That makes a float go from 0 to 1 over the course of 1 second.
I also set it to “loop” at the top, with that checkbox. That means it’ll repeat itself until the Timeline is told to stop. It’ll go from 0 to 1 over and over again.
Now in the event graph, I multiply the output float track by 360. That’ll give you a full rotation, 0 to 360, every second. I plugged it into roll, but you can plug it into whichever rotation value you need, depending on the gear’s facing.
Use your actor reference in the level, or save it to a variable with casting, and use a Set Actor Rotation node from it. Finally, plug the Update exec from the Timeline into that, so it is constantly updating your rotation with the values outputting from the float track x 360.
And for good measure, I demonstrated how you could have some custom events plugged into the Timeline so that you could start/stop it whenever you want. If you’re building this in the level BP, and are wanting to call those events for start/stop from another BP, you can bind them to an Event Dispatcher.
Here’s info on Timelines:
And here’s info on Event Dispatchers:
Let me know if you need anything else or if this isn’t quite what you needed!
is this done in level blueprint?
It can be if you want. I’d recommend it since it’s a level component. If you select your gear actor in the level and go to the level BP, you can right click and you’ll see a Add Reference to blahblah option. Something like that. It’ll create a variable that contains your gear actor, which you can then use nodes like Set Actor Rotation and apply it directly to the actor without having to get the actor by casting.
i cant seem to find the timeline option whenever i type it in
got it, what node did you use for the 360?
Make sure Context Sensitive is checked. Also, it’ll be at the bottom as Add Timeline, like in that picture
nm found it
You’ll have to adjust the rotation values to match it’s normal values. So if in the level, the Roll is 90, and Yaw is 0, and the Pitch is 180, you’ll have to adjust the values in the Make Rot node to match that. And if the axis you need to use for rotating also has an initial offset, say Roll 90, you can do an Add node after the 360 multiplier. That’d make it go from 90 to 450 (full circle based on 90 offset).
Does that clarify everything? Let me know
Those are also some cool assets. Did you design them?
yes i did its my demo reel for graduation, its not the best it can look i got pretty lazy with it
and no that was a little confusing, im not a coder lol my brain turns to mush with this stuff lol -0.0-
I’m not one either, or at least I didn’t start as one. I started using UE4 in June with no experience. I suppose using it so much is rewiring how I explain things haha
In simpler terms, when you placed the actor in the level, you might’ve had to rotate it to set it how you wanted. You can see those values in the Details panel when clicking on it in the level.
So, it seems you have a default value in one of your 3 rotation axes that isn’t 0. That Make Rot node is applying a change to a rotation value to make it rotate, and the other 2 values are kept constant. You’ll need to make sure that your default values are plugged in there.
Essentially, you have to supply its original rotation and then apply changes to it
umm i think iv got iy, also i want the larger gear to turn too i have it set up just like the smaller gear but when i compile and press play its still static like only one event can play at a time,.
Think of Timeline systems as separate entities. A gear, or a door, or even any kind of perpetual function that you want to have control over for starting/stopping, would have its own system, activated by its own custom events. You can fire off those events however you want.
An easy example would be something like Event Begin Play > Activate Gear 1 Timeline > Activate Gear 2 Timeline
so i have a whole seprate node tree made up but do i use the same event starter ? or do i assign it to both some how?
Create a new custom event for each one. Right click, create a Custom Event. Plug one into Play on one node set, and another into Play on the other node set.
It’d be good to setup a some custom event to Stop each one too. That way you could have the gears start and stop any time you wanted.
You can call these events at any time by right clicking and typing in their names. You can call both of them one after the other on Begin Play or wherever else you’d like
Nono, once you setup the custom events in the BP, you can activate them from another point in the BP by right clicking and typing the name of the custom BP.
So… right click. Create a Custom Event. Name it. Plug it into Play on the Timeline system for gear 1.
Repeat for gear 2.
Get your Event Begin Play node. Now get your 2 custom events. Right click and type their name in to get them as a node.
Plug Event Begin Play into custom event 1 and plug that into custom event 2
Event Begin Play node > custom event 1 node > custom event 2 node.
Each one plugged into their corresponding Timeline Play inputs.
but if i wanted them to start as soon as i click the play button? i have a camera fly though so i haveing to type them in is unconventional to my presentation