x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How Do I Make Items Orbit Around An Actor In Blueprint

Imagine my actor is the sun. I've placed spheres around the sun in the blueprint and gave them rotational movement. How can I make the planets rotate around sun now? I've read something about using spring arms but nothing that sets it in stone for me.

Product Version: UE 4.19
Tags:
more ▼

asked Sep 17 '18 at 06:56 PM in Using UE4

avatar image

zeltparker
13 3 2 7

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

There's got to be more than 10 ways of achieving what you need. Here's what you mentioned yourself:

Image from Gyazo

alt text

capture.png (14.6 kB)
more ▼

answered Sep 17 '18 at 09:14 PM

avatar image

Everynone
15.3k 77 26 62

avatar image ThompsonN13 Sep 17 '18 at 09:38 PM

hmm i added a similar answer earlier but it didnt go through. you dont actually even need the spring arm, you can just place the mesh at the distance you want the orbit to be and it will still act in the same manner.

avatar image ThompsonN13 Sep 17 '18 at 09:55 PM

i cant find the thread made recently where i posted this example but the picture below shows how i implemented a rotating planet system. one of the major features here is that you can modify values like orbit radius, planet size, and you can use this to add moons which travel around their parent planet.

if you look in the variables section at the bottom left you will see the public variables i used which can be set in the details panel of the level editor on a per instance basis. note that rotation rate is the orbit speed.

alt text

capture.png (328.0 kB)
avatar image Everynone Sep 17 '18 at 10:02 PM

True, true, one less component is always better. Op wanted a springarm so here's one.

avatar image zeltparker Sep 18 '18 at 07:21 PM

Hey, what you set up in your pictures are exactly what I'm aiming for. I've got what you have set up in mine but the sun spins as well. Basically the whole blueprint spins. How can I alter it to where just the planets rotate around the sun? Sorry that I can't do it based on what you've given me. @Everynone

avatar image Everynone Sep 18 '18 at 07:46 PM

No worries, I just followed your suggestions closely. If the sun is spinning, don't use a rotating component in the sun. Use it just in the children actors. Depends on your setup.


I've got a space project myself but I'm using something a bit more advanced since my orbits need to be titled ellipsoids and the whole lot is generated procedurally. An object pooling system of splines + spline mesh components (to visualise the orbital mechanics) that any celestial marble can glide along. All controlled by a single timeline float in the parent.

Good luck!

avatar image zeltparker Sep 18 '18 at 07:43 PM

I figured it out after playing with it for a moment

alt text

springarm-orbit.png (108.6 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

One way to achieve this is by using a matinee where you need to :

  1. Right click at left down grey area and create new empty group

  2. Right click at the new empty group and add new movement track

  3. Select the object you want to set on rotation and go back to matinee

  4. Right click the new empty group and add actor >add selected actor

  5. Select the movement track

  6. Set movement duration and location at different moments of your object . You need to change the location of your object manually and the time in the matinee and add a new key to each location-time of the object

  7. Go to level blueprint and activate this matinee with the node Play and connect your matinee to it

  8. (Bonus) With some basic scripting you can set that matinee on loop . For example use Event tick node then create a boolean variable and each time check with branch node if that boolean is true. If yes play the animation. Then make the boolean false. Then use delay node for as long as the duration of the orbit is. Then set boolean back to true.

I am pretty certain you can achieve this totally through blueprint scripting by using nodes Get actor location , set actor rotation , get forward vector but I have not tried this myself . I hope I helped you. Good luck!

more ▼

answered Sep 17 '18 at 08:46 PM

avatar image

VortXGaming
253 5 5 12

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question