Object rotation around another object

I tried creating a planet and a sun. I tried to make the planet rotate around the sun. I found this question but I am obviously not getting the whole picture

How can I make my planet rotate around the sun? - Community & Industry Discussion - Epic Developer Community Forums

I am doing only the location transformation and not the object rotation.

Now I think my problem is with the object refrence. I am still new to blueprinting. Thanks in advance

1 Like

I think “Rotate Vector around Axis” is what you need. For the vector, you can just put the distance between the planet and the sun as the “x” value, and then change the value of the angle every tick. The “axis” value would be the location of the sun.

gogata258 - could you please post your solution to this? I have the same issue and have noticed there are multiple threads asking this question - with no solutions posted.

much appreciated!

1 Like

The answer given by Tularth is the correct one. And If you are using c++ Fvector class has the same function

gogata - Yes! I read the answer below but can’t get it to work. Feeling stupid here. Would you be so kind as to upload your working blueprint jpg? appreciative of your time and I believe it will help others as well - there are many threads on this!

In your blueprint you’re setting the delta transform, which is the difference between the previous and next Location. You either want to use either SetWorldLocation or calculate the actual delta transform by subtracting the previous location from your new one.