Is tick for planet orbits rotation

I’m trying to model a solar system which will be generated randomly, I’m currently using event tick once the planet has spawned to make it rotate around the sun. I’m using delta rotation.

My concern is the moons (when I add them) will be rotating around the parent planet, and as I want to keep them all as separate actors I’m concerned including a call to the planet for its current location (so the moons orbit is around the parents center) will start causing performance issues.

Is there anyway I can avoid using tick, please bear in mind the systems will be random and could potentially be similar to our solar system (gas giants and there moons as an example).

Well, you shouldn’t be concerned, it won’t be that computationally complex. If you feel uneasy about your solution please submit a screenshot showing us how exactly you calculate planet/moon transform. General rule of thumb: you should not worry that much about optimization unless you already noticed a FPS drop. If you don’t want to use tick there are timers for which you can setup your own refreshing rate. Moreover, in your planet/moon BP you can specify “Tick Interval (secs)” in Class Defaults->Actor Tick.

You will not get performance issues from setting 100 actor locations per tick. The problems may arise if you do more during that tick.

Also, if you have more systems with more objects, do not tick the ones the player cannot see. As soon as the player leaves a solar system for good, store the orbital values in a variable. Upon revisiting this system, fetch those values and multiply it by the time elapsed since the last visit, apply new orbital coordinates and start ticking what the player can see. As if nothing happened.

Also, every object can be set to Tick at a different interval. Class Defaults → Tick Interval

Alternatively, you could use Timelines instead of tick but 100 Timelines will be heavier than 100 ticks, surely.

edit: I see @ChopinDev beat me to it. :slight_smile: