News Forums Sentio Characters General Discussion and Troubleshooting Some help with giving my Sentios damage

This topic contains 2 replies, has 2 voices, and was last updated by  MangeyD 2 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #37106

    MangeyD
    Participant

    I have been enjoying playing with my Sentio’s but I can’t seem to give them damage from a character I am controlling. They see him and give him damage but even tho I attack back I can’t seem to give them any damage.

    An overview of the concept for giving them damage would be great.

    Thx

    • This topic was modified 2 months ago by  MangeyD.
    #37124

    prime
    Keymaster

    The DamageMessageReceiver component handles all damage dealt to Sentio Characters. You can use this with Unity’s normal message passing system by calling BroadcastMessage on the AI game object (Body), or SendMessageUpwards on any child object. Take a look at the DamageOnCollision script for an example.

    The “message” you want to send is “Damage” with a value defined by the type DamageMessage.

    For example:

    //in this example "myGameObject" is the game object sending the damage
    //and "aiChildObject" is a child of the AI Body for the AI receiving the damage
                DamageMessage tDamage = new DamageMessage() { damageGiver = myGameObject, damageAmount = 10f };
                aiChildObject.SendMessageUpwards("Damage", tDamage, SendMessageOptions.DontRequireReceiver);
    #37132

    MangeyD
    Participant

    thx for that info… won’t get to play with that for a day or so now but I will give it a try

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.