Rotating static mesh

Hi all, i’m trying to build a rotating mesh in unreal 4 I used a blueprint for this but it only worked 1 time trying to recreate it did not work.
I done get actor location 2x in my blueprint and manually rotating it but i want it to keep moving and after playing 1 time it did not work a second time and not able te make it again and get it working.

Can someone give an explanation about how you can make something rotate using blueprints?

I watched a lot of youtube video’s but failed.

Greetings,

can you post some screenshots of your event graph so we can see how your blueprint works, cheers

It didn’t work only 1 time but a 2nd time and its not working if i remember correctly I added the static mesh in the blueprint and a add rotation and 2x get actor location and manually rotating 1.

http://s21.postimg.org/qo2a8je2b/Capture.jpg

It was something like this but doesn’t work I want it to rotate in place.

float fCurrentRotation = 0.0f;
flaot fRotationSpeed = 1.0f;

if(fCurrentRotation < 360.0f)
{fCurrentRotation += fRotatiobSpeed}
else
{fCurrentRotation = 0.0f}
Apply fCurrentRotation to the object each frame

Thats roughly how it would look in code, but the concept is exactly the same in blueprints

Can you provide a screenshot how it will look in a blueprint for instance if i want a earth spinning 360 degrees in place?

Greetings,

Here we go. I knocked this up for you. It works perfectly. Again, it’s the exact same concept as the code.

If fCurrentRotation is less than 360, it increments it. It otherwise sets it to zero.
A rotator is then made from updated fCurrentRotation and applied to the object

you can ignore the fRotationVector variable, it didnt need that in the end.

Easy :slight_smile:

P.S If you want to be able to adjust the speed that the object rotates, just figure out how to change the increment amount. At the moment it increments by 1.0f every frame. I’ll let you figure that one out on your own :slight_smile:

Thanks for that screenshot, I have it replicated but it doesnt move can you confirm?

http://s11.postimg.org/5uf285wof/Capture.jpg

Greetings,

Can anyone confirm if it’s flawed or point out something that is not done right?

Greetings,

hmm, did you make the object movable? Or is it still static?

Also, consider to add a print string to fCurrentRotation, so you can at least see that the incrementing is working properly.

Hi guy’s my fault!

If I spawn the blueprint class from that static mesh it is rotating sry I was using the static mesh, to texture that blueprint clas just press static mesh in the details panel.

Thanks!

Greetings,

Glad you got it eventually :slight_smile:

Haha I did still figuring out how to change the rotation angle currently it’s rotating like if it was a ball rolling, any hint’s on where to look?

Greetings and thanks!

Yep, I’ll just give you a hint because it’s very simple :wink:

Check the blueprints again. You already have everything there you need. You just need to change two wires and that’s it. It’s very basic! :slight_smile:

Oke thanks for inspiring me to learn more I appreciate it!

Did you figure it out in the end?