Monday, 27 February 2017

Idea Generation for Computer Games - NPC implementation: Collision Detection.

To apply collision values and with that, damage, I needed to bring in three more components to the character blueprint, these were all collision capsules, placed on the hands and the right foot of my NPC.

Within the attack animations I had made into Animation Montages, I needed to implement AnimNotifys for enabling and disabling the collision on each of these capsules, with these AnimNotifys set, these were, in the exact same way as linked with the playable character, linked to a custom event through the animation blueprint, these custom events, located in the character blueprint, were linked to "set collision enabled" nodes, with each of the new collision capsules being given their own set of enable and disable nodes to refer to.

To make sure that the collision was registering on overlap with the character, a series of 'cast to character' nodes were added, which followed with a reference to more custom events, which were simply linked to print strings to show that the collision was happening, ready to have damage functionality implemented in later.

Below is a screen grab of one portion of the setup, showing the collision capsules being both enabled and disabled;


No comments:

Post a Comment