Download

Pawn Collision Doesn't Work While Moving

Hello,

I’m encountering a problem with collision in my space shooter when moving.

During play, I attach a shield actor to protect just the front of the ship. The ship moves programmatically and the shield is attached so it moves with the ship.

The obstacles move with physics and impulse. They trigger overlap events with the ship correctly while it is still and while it is moving. They also trigger overlaps with the shield while it is still. However, overlaps with the shield while moving are unreliable and often don’t fire at all.

I’ve tried a number of modifications such a CCD, and making the collision box for the shield much larger.

Any advice on why moving an attached actor would not trigger overlaps against physics objects would be appreciated.

Cheers.

I’ve since read that sweeping does not occur on actors parented to actors. Alas.

Interesting… Was there any more info on this… Can you cite some references etc… For starters, does the shield itself ‘simulate physics’: yes / no?

Experiments I’ve done in this area usually return interesting results…:smiley: Either the attachment fails for some reason, or fights the parent with physics, or some other outcome. For example docking a sub-ship at the front of a Mothership can lead to unpredictable results, so much so, that even if you get it working in standalone, it doesn’t work or behaves erratically in multiplayer on the server or clients etc.

So I’ve come to the conclusion that often its easier to just fake it. For example, make the shield actually part of the Parent Ship’s blueprint, but invisible with collision off, until its actually needed (even if that means creating a separate pick-up for the shield as a separate actor, and then destroying that later in a swap etc).

In general, its easy to run into bizarre results attaching physics object’s to one another, and getting both of them to move properly and do collision detection… So one other option is disable collision and physics on the shield, and then attach it. Sometimes this gives different results than doing an attachment without those steps. Alternatively, disable collision and physics on the shield and then just extend the collision of the ship to encompass the shield (so effectively the shield is just cosmetic)…

Thanks for your response, @ClavosTech ,

The shield itself doesn’t simulate physics, no. Only the obstacles do. So I’m not trying to attach physics objects together.

I’ll try implementing your techniques and see if I have any more luck with that.

Thanks for your time.