Enemy Damage

square357

New member
I am a little confused on how to set up damaging and destroying enemies.

I believe that I have figured out how to add collider and health script, but I am unclear on how to subtracts health.

Any help or point in a tutorials directions that covers this would be appreciated

This tutorial mentions a vp_damagehadeler script that are not in the UTPC so it is not the answer.
 
Last edited:

Could you please expand on this more? This page leaves so much unclear.

In the video the user posted, they are able to setup receiving damage from within the Inspector. In the link you share, it talks a lot about the Event system. Within the Health and CharacterHealth scripts, there is a reference to all these events, but I can't seem to get anything to happen here. Those code examples are nice, but it is so confusing to see nothing but code for an asset that supposedly allows you to do the bulk of the work within the editor. I've been banging my head against this for hours and it's maddening.

Will Opsive consider doing more up-to-date tutorial videos that show people how to setup projects using your asset? What videos you do have are so incredibly brief, it's very hard to take the information you share there and put it into practice.
 
The video above is from version 1 so I wouldn't use that as a reference.

That page mostly talks about scripting because the character controller will automatically damage any object that has the health component on it. From the demo scene the red boxes have the health component attached so you can use that as an example and it really is just attaching the component so it's not enough to do a video on.

Unity actually did a similar thing in one of the promo that they released on using assets from the store:

 
That page mostly talks about scripting because the character controller will automatically damage any object that has the health component on it. From the demo scene the red boxes have the health component attached so you can use that as an example and it really is just attaching the component so it's not enough to do a video on.

Sure, maybe that single aspect of it isn't enough to do a video on, but do you really feel like the robust feature set you have around managing character health and other attributes isn't more deserving of a visual demonstration?

I finally figured out part of what my issue was and the issue was that I just couldn't tell when something was working and when it wasn't. I setup the character through the character manager, which seemed to work better than just trying to attach the scripts on my own. To test if the character was taking damage, I setup an audio clip to play on damage. That audio clip never played. When the object was hit, there was no indicator in the console. The only way I was able to finally notice that the object was taking damage was when I happened to be hovering over the health values in the Inspector while shooting at the object in play mode.

If I toggle "Deactivate on Death", that works just fine. Why does that work and not the audio clips? I have no idea at all, and the only way I'll get any clue about it is to jump back and forth between the demo scene, the documentation, these forums, and the discord channel.

I think most people on here are okay with trying to figure things out to some extent, but gosh. A 30 minute from you guys running through setting up this asset in some basic projects would go an insanely long way in making this asset more accessible.

You're an incredibly nice guy and I'm always amazed at how much patience you show when helping people, but man. I really wish we had more materials to learn from so that we could reference those more instead of desperately waiting for you to swing by in the forums or on the discord and save the day.
 
Top