Character facing incorrect way on spline path
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.
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).
Follow this question
Once you sign in you will be able to subscribe for any updates here