How to make the moon orbit the level?

Hey all I have a moon bp that is a physical object and i am trying to get it to orbit the level like the sun. I have it set up to constantly face the 0,0 of the level but when I orbit it in the event graph the entire thing wants to orbit with it.

Is there a way to just set a timer add a rotation to make it rise above the horizon and dip down? adding a rotation to just the moon component makes it spin in place, and doing the entire moon bp makes the glow plane and light rotate as well, despite the lock to point towards 0,0.

Add another component to the BP, a massive sphere. You can make it a collision component, but then set it to ‘no collision’, because we’re not interested in that.

Then connect your moon to the sphere ( in the top left pane, drag it onto the sphere ). Then you can rotate the sphere and the moon will go with it, but not the glow and light…

:slight_smile:

It’s a bit basic, but you get the idea ( my light is just a cube )

285829-moon.gif

Hmm for some reason it only wants to rotate in a small circle around the collision. And nothing else is following.

I need it to orbit around an object while the glow, light and moon would still be turned towards 0,0,0. But when it is rotated it seems to ignore the construction script?

You can’t put any of the rotation in the construction script, that only gets run when you drop the actor in the level. Can you show me the structure of your BP now?..

It’s a custom event setup to increment a float with a timer.

I need a way for the moon to orbit the level’s 0,0,0 while the glow plane and light stay behind it. They can’t be children of the moon though cause I have a simple function exactly like the one above that makes it slowly rotate on it’s z-axis.

So I guess I’d need to rotate all 3 at the same time? Around the 0,0,0

No, you’re missing it… :slight_smile:

One BP, it contains moon, glow, light and collision sphere ( set to no collision ).

All of the components are independent ( not connected to each other ), except the moon, which is connected to the large sphere.

You then can place the BP at 0,0,0 in the level and rotate the large sphere with your timer. The glow and light will not move…

Is there a way to have the sphere go to 0,0,0 without having to move the entire bp? And I don’t think that would work anyways since the construction script won’t keep the other components locked to face 0,0,0.

Logically, th esphere should go to 0,0,0, but you can position the BP and the sphere and other components in any way you want.

There sphere can go at 0,0,0 and not affect the other components, as long as they are not connected to it.

If you move the components within the BP ( drag ), you will see them move in the world. So you can actually have the BP anywhere you want, and the components also.

It’s all to do with whether or not they are connected to each other…

Just tell me how you want it to work and I’ll send you a link to a small project if you like…

At the moment I understand:

3 objects in the BP. Moon, which should orbit. And two lights, which should stay still.

Is that it?

Well the glow plane should always be behind the moon and the light should always be infront. They aren’t conencted together as the moon needs to spin around it’s own z while rotating around the world.

So any world rotation needs to be translated to the other 2 components as well.

Here you go:

https://drive.google.com/open?id=1qw1AQrjtbf7ifrGpefhnuXWD28qEb8te

Link is borken, thanks for help thus far though. I was thinking of a system that rotates all 3 pieces at the same rate? Seems easy enough.

Try this:

https://drive.google.com/open?id=1qF5W19h6WEeASenrs9XxYWfyheNKuAJt