Hi everyone. I have seen a few such questions around but none seem to have a definitive answer as to how and if this can be accomplished.
I have a RTS style camera, and I want to click on specific actors to enable manipulation while in-game. I am “switching” control to the clicked on actor in my controller and then moving said actor with Set Actor Location. The actor moves but it just goes through everything in the level as if it wasn’t there.
I tried setting Sweep to true on Set Actor Location andand other tweaks found in similar questions but I couldn’t find what is wrong.
Can I have the actor I am moving in runtime collide or else not go through and ignore others? If so, how?
Thanks
Hi @VulcanoDetrol
Sweep only gives you information about what translating the actor from A to B found in the way, doesn’t prevent going through objects.
So what you probably need is to just use that information in a similar way of this image
This is a very basic control, you will possibly want to control the distance of the “blocked/hit” Location with the actors’ bounds or use Impact Normal for some other calculations, etc…
Depending on your intentions or the conditions of your scenario you may want to use a LineTrace or SphereTrace (to cover a bigger size actor) before moving the actor to decide what to do with it before actually moving it.
I hope that helps
1 Like
Thanks! That makes a lot of sense.
The problem is that now that I am testing this I am getting no TRUE result either for checking for blocking hits or even initial overlap.
I am not sure what is causing this, as inside the actor I am moving I have ActorBeginOverlap and ActorEndOverlap events and they are firing correctly when intersecting with other actors.
Do I need specific components (or settings on the static mesh components) on the moving actor and/or the others for the hit/overlap to get acknowledged when sweeping?
Make sure you have this set to True in the components of your Blueprint that you want to check collision and overlap


Also, check that you have your collisions set properly. If you’re using just a static mesh check that it’s not missing the Simple and Complex collisions.
You can always add a Box / Sphere / Capsule collision to your Blueprint to make sure it works.