NotifyHit / Collision not working

Hi All,

I am very newbie in Unreal, I was developing with Unity C# for several year, so maybe I am missing something,

I started with the flying base (the one with the UFO) and when I flight with this UFO and I hit the blocks the UFO stops… great, so I try to create my own Pawn Actor with the following structure:

Pawn
Axis (An Empty Actor)
[INDENT]Mesh[/INDENT]
[INDENT]SpringArm[/INDENT]
[INDENT][INDENT]Camera[/INDENT][/INDENT]

A Clone the C++ classes for my new Pawn, every is good, I can fly with my new Pawn however the hits are not working. I try adding a Capsule Collider Component too to the hyrearchy but still not working.

Any ideas?

Thanks in advance
Jose

What exactly is going wrong? Is your pawn not blocking (going through walls)? Or is not generating the blocking events in C++?

For the latter: Call Mesh->SetNotifyRigidBodyCollision(true) and override AActor::ReceiveHit

Note: If your mesh already has a collision mesh associated with it through the editor then you don’t need a capsule component.

I have both problems MaxL… my pawn is going trough walls and not generating blocking events.

I will try your suggestion and I’ll keep you posted.

Thanks for reply :slight_smile:

Drag your pawn into the world and in the details panel under collision check if your collision presets are set to block all for the wall and your pawn.
If you’ve got that set already then maybe your collision mesh isn’t encapsulating your static mesh entirely?

Hi MaxL

This is my Pawn Actor configs and it’s not blocking :frowning:

Hey buddy,

I fixed the problem.

The problem was my empy actor “Axis”, this actor have not an collider so I never get response to notifyHit and my mesh (p47) was a child of this empty actor, so his collider was not helping here.

What I did was replace the empty actor by a box collider and then make it the root and now works fine, this is the config:

Now works as I expected to work… As 5 years Unity developer I only can say this is a very weird to do the things but OK, I will learn this new way :slight_smile:

Thanks for the update.

You don’t have to do it like that though, your initial method should still work. I’ve got a scene component as my root and a mesh attached to it. The mesh has its own collision options such as blocking and a receiving hit events checkbox. If you set those up then the collision will work as you expect and notify you. Your mesh however should have its own collision for that to work. To check that find the asset in your content browser, double click the static mesh, click on the collisions box to see the collision wireframe. If there is none then the mesh doesn’t have its own collision data which is why it may be going through objects.

The Mesh (P47) have his own collision as you can see here:

airplaneMesh.png

But if he is a child of a scene component the collision detection do not works.

If I setup the mesh as root the collision works, however I do not want the mesh as root (because I wanna perform with him independent actions to the root), Currently the unique configuration working as I expected is the one I show you before.