Creating a custom object collision channel

We are nearly ready to place all of our pieces in the game world. Before we do that we need to create the aforementioned custom collision channel. We can do this via Project Settings. Navigate to Edit | Project Settings. Once there, navigate to Engine | Collision. This will present you with a settings menu with two categories ObjectChannels and TraceChannels. We are going to be adding a new object channel. This can be done by pressing the NewObjectChannel button, which will present you with this wizard:

Creating a custom object collision channel

With this wizard create a new channel called BMCharacter with a default response of Block. This channel is the one we are going to be setting as the collision type on our FPCharacter. As this is the first custom channel we have created, the ECC_GameTraceChannel1 enum will resolve to this channel and our sweep test will only pick up collisions with objects that have set BMCharacter to be their collision type.

Open the FPCharacter blueprint now and select the Capsule component from within the Components panel. Within the Details panel navigate to the Collision section and expand the Collision Presets category, ensure it matches the following:

Creating a custom object collision channel

Here we have stated that we wish to use a Custom… collision preset. We have set the object type to be our new BMCharacter (which would have been added to the list of available options, if it didn't, ensure you added the custom collision object channel correctly). We have then set the collision response grid to replicate that of a pawn so the character will still function as intended within the game world. Now we can finally modify our level to show off our AI!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.151.153