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"

Character facing incorrect way on spline path

Hello, everyone.

I followed this tutorial (https://www.youtube.com/watch?v=Xzi-juho9Ik) to have an actor (in a soldier appearance) follow a spline path. However, although he is walking along the path, he faces towards the wrong direction. He is now walking side-way along the path rather than facing forward. I tried changing the hierarchy structure, rotating the actor, rotating the spline path itself but nothing has worked so far. Any idea what might be happening and how to correct it?

Notes: the coordinate space is set to "World" on both functions "Get location at distance along spine" and "Get rotation at distance along spline." Changing the coordinate space to "Local" didn't fix the problem.

I appreciate your response.

Thank you.

Product Version: UE 4.19
more ▼

asked Jul 05 '18 at 02:08 PM in Using UE4

avatar image

Jasmine D
10 1 2 5

avatar image ThompsonN13 Jul 05 '18 at 02:23 PM

show us your script so we can see what youve done. the simplest answer would be to add a offset to the rotation but there mey be a better solution if we see what youve done.

avatar image Jasmine D Jul 05 '18 at 02:43 PM

alt text

spline-path-2.png (225.1 kB)
avatar image Jasmine D Jul 05 '18 at 02:43 PM

alt text

spline-path.png (826.5 kB)
avatar image Nebula Games Inc Jul 05 '18 at 04:44 PM

Is "Main Player" the top of your actor hierarchy? Possibly it is rotating something else in the actor and not the actual mesh? I can't see from you current screen shots.

avatar image Jasmine D Jul 05 '18 at 04:50 PM


The "Main Player" is not on top of the hierarchy. The "Scene" component is the current root. When I try to simulate the game with the "Main Player" as the root, everything goes out of whack. Let me upload a screenshot of my current hierarchy.

avatar image Jasmine D Jul 05 '18 at 04:52 PM

alt text

hierarchy.png (17.4 kB)
avatar image Nebula Games Inc Jul 05 '18 at 05:08 PM

I see what is going on. It was odd to me that you had the "spline" component as part of the actor you are trying to move.I recommend keeping them separate. But in any case, if you look closely at the tutorial you linked to, the hierarchy is "spline" no children, and "cube" no children. So they are completely separate components when you rotate. You are rotating a child component but not the parent and I think that is causing some issues. Try dragging "Main Player" and dropping it on top of the "spline" component. This should then remove it from the spline hierarchy similar to how your "billboard" component is not a child of your "spline" as you can see by the indentation.

avatar image Jasmine D Jul 05 '18 at 05:16 PM

Thanks for replying. That actually was my initial setup. It didn't work so I tried rearranging the hierarchy into what I have currently to see if it would fix the problem but it hasn't. I'm not sure if I'm making any newbie mistake in the settings over in the details window.

avatar image Nebula Games Inc Jul 05 '18 at 05:24 PM

Hmm, it doesn't appear you have although I've never set up a spline like that before. Try maybe instead of the "transform" node set world location and rotation separately. It shouldn't make a difference but sometimes the game engine is weird like that.

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

1 answer: sort voted first

i think your rotation is off by 90 degrees for the skeletal mesh. if you select the mesh and it shows the location gizmo which way is the red arrow pointing? if its not facing the characters forward direction then thats the issue. this is easily remedied by either adding an offset to the rotation in your script or by adding a scene component then making the mesh a child (of the scene component just created) and rotating the mesh in relation to its parent. then you would move the parent instead of the mesh.

though this wouldnt solve the issue of your other question thread. to solve all the issues at once i would abandon the idea of having everything all in one blueprint. i did some testing and im not sure components in the same actor can overlap so i would either spawn the skeletal mesh at runtime or use one thats placed in the level. in the picture below you will see an example script that uses a mesh placed in the level. the basic idea is that we will get a reference to the skeltal mesh actor via a public variable which will need to be set when you place the spline bp in the scene. so create a variable (i called it character mesh), make its type skeletal mesh actor object reference, and make it public by clicking the little eye next to the variable name in the bottom left section. then setup the script as shown in the picture by replacing the set world transform node with a set actor location and rotation node and the variable. also just prior to the setting of the rotation i used a combine rotator to offset the rotation to compensate for the mesh rotation being off by 90. you will also need to adjust your overlap event on the box collision to check for the different actor (i showed this as well resulting in a print string).

alt text

capture.png (327.4 kB)
more ▼

answered Jul 05 '18 at 10:33 PM

avatar image

10.1k 33 10 25

avatar image Nebula Games Inc Jul 05 '18 at 11:34 PM

I would recommend a set-up where the spline and the character you want to move are not part of the same blueprint. The set-up I have created below will allow you to put in as many splines as you want and move as many actors as you want. It is more versatile than the tutorial you watched which only allows you to move 1 specific actor and might make it easier to troubleshoot rotation issues. Here is the set-up. The insides of the timeline work a bit different because instead of setting a hard and fast "length" and a float track to make the distance go 0-100% of the total spline length, I created a variable to keep track of the total distance. There is another variable I created and made public (check the little eye next to the variable) called "speed" (set it to like 500+) this allows you to change how fast the player or object moves along the spline path from the editor without having to enter the BP itself. My timeline loops, but in your case I wouldn't have it loop, I would change either the speed or length of the timeline in seconds to suit your needs for when you want the player to stop. The "actor to move" variable is created by clicking on the variable "+" on the left hand details panel and searching for actor object reference. The second image shows you how to set the "actor to move" variable from the editor. Select the spline track and on the right side details panel you will see the public variable "actor to move" you can then choose any actor in your level to feed in.

alt text

alt text

alt text

spline.jpg (238.3 kB)
spline-2.jpg (194.7 kB)
spline-3.jpg (107.2 kB)
avatar image Jasmine D Jul 09 '18 at 06:28 PM

Thank you both ThompsonN13 and Nebula Games Inc for the instructions.

avatar image Nebula Games Inc Jul 09 '18 at 06:51 PM

No problem. I'm assuming you managed to figure it out then?

avatar image Jasmine D Jul 11 '18 at 12:29 PM

Sorry for the delay in response.

Yes, partially. I decided to rest this case for now and focus on my cinematic with sequencers first since there's a tighter deadline for that. Of course, I have tons of questions regarding that topic as well. I will be posting them shortly.

Again, thank you so much for your time and guidance.

avatar image Nebula Games Inc Jul 11 '18 at 02:44 PM

Fair enough. Well ask away, we are all here to help you meet your deadlines haha

(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