Pawn movement


I have a pawn class. As a child on it, it has a scene component and as a child on the scene component has a static mesh set as moveable. If I want to move the object around, should I be doing setworldlocation on the static mesh or should I be using setactorlocation on the actor/pawn.

If I do setactorlocation, the static nesh doesn’t move with the pawn. The transform stays the same while the transform on the actor tree level changes.

If I do setworldlocation on the static mesh, the mesh moves but it seems funny that I have to move the child to move the whole thing.

No answer to this question was given. It seems like a basic question, but I would like to see a good response to this also. I, too, had code working with the static mesh setworldlocation, but it seems as though you should be able to move the pawn using setactorlocation, also. Can someone please give an explanation here? Thanks!

Curious, how did you both arrive here ‘learning wise’… YouTube etc?
Recommend projects / templates by Jacky TheJamsh CoquiGames…
Typically you move the containing [Pawn] Blueprint (Self)… Example:…n-bp-ship-roll

BTW: There are Answers on here Search Forums / Answerhub… But you have to hunt for them more now!
So be self-sufficient, don’t expect loads of replies for questions answered elsewhere as forums are quiet!

Thanks. I did some tutorials and some of a Udemy course. A lot of web searches, but I tend to learn as I go by figuring things out - and then forget what I did later, unfortunately. :slight_smile:

I am actually doing a mix of C++ and Blueprint, with this particular work part of the C++ code. I realize the original question I piggybacked on was for Blueprint, but I guess it seems that the question is the same regardless. I have extended the APawn to create a custom pawn that I can control movements of using scripted waypoints or other means. I can set the position using Model->SetWorldLocation, so hopefully that is the correct way. It works, but I guess I do not understand why SetActorLocation does not work, and I’m a bit concerned that there may be an issue I’m not aware of. Anyway, like I said, what I have does work, so unless anyone has a comment to correct my misunderstanding, there is no further reply necessary. Thanks again!