Building a Pawn who moves and collides


I’ve been struggling with building a simple enemy Pawn BP that moves around and collides with things, including the ability to fall. I have finally proven that my setup using SetActorLocation + “Sweep” is getting the OnComponentHit notification from an object that tells the enemy to move in another direction (a fake trigger I built). However, if I set it up one way, it never falls, but the only other way I can see makes it roll around randomly (Simulate Physics).

My setup is as follows: I have a Pawn BP with a StaticMesh and a Sphere Collision Component. I am using SetActorLocation to move it in a direction. If I have “Simulate Physics” set on the sphere but not on the StaticMesh it moves in the direction I request, but does not fall. It also doesn’t give me OnComponentHit events against my trigger object. However, if I set “Simulate Physics” on both components (or just on the StaticMesh), it falls, and gives me OnComponentHit events. These OnComponentHit events also seem really finicky and I haven’t tracked down how to make them work as expected. One of my test objects doesn’t trigger it, but the other does. With “Simulate Physics”, it then proceeds to just roll around and never ends and doesn’t honor my SetActorLocation calls.

I’ve read a number of articles on this and many people have seemed to struggle with it. Is there an official page that describes this process? If not, is there any advice you can give me that can help me track this down? Why do I not get OnComponentHit events when “Simulate Physics” is set on the Sphere Component, but do on the StaticMesh? Is there a way to prevent the enemy from just bouncing around and instead stick to the object like a character controller does…while honoring SetActorLocation?

I understand that I could just use a character controller, but it has it’s own issues I’m trying to get around (I’ll save that for another thread), and doing that doesn’t let me understand the full process.

As a side note, any idea why having the enemy setup to simulate physics (causing it to roll around) would launch it into the air at the start of the level, even if it starts 500 feet up in the air?

Please let me know if there is any more information I can provide that will help. Thanks!

In fact I have two objects that have identical settings (one built off the other and all changes undone to verify this) and only one generates an OnComponentHit event on my custom trigger object. Note that this also has the same OnComponentHit fail/success cases as the above issue describes). How is one of my objects succeeding, but the other failing?

Wow. If I move my second enemy over to collide with the first custom trigger I’d created, I DO get an OnComponentHit event. The second enemy was copied from the BP, then the custom trigger was copy pasted in the editor and moved to where the second enemy would hit it.

Is there a special instancing thing in Unreal that I need to know about where a BP for one object does not work when the object is copy/pasted? Are breakpoints only placed one ONE instance of the object? If so, how do I debug other instances?