Forum begins after the advertisement:


[Part 15] Aura not destroying Props

Home Forums Video Game Tutorial Series Creating a Rogue-like Shoot-em Up in Unity [Part 15] Aura not destroying Props

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #16940
    Sean
    Level 11
    Former Patron
    Helpful?
    Up
    0
    ::

    Hi,

    I was wondering if there was an easy way to also check for props within the aura’s range, instead of just enemies.

    Kind Regards, Sean

    #16944
    Alp Apustaja
    Level 1
    AI Assistant
    (BETA)
    Helpful?
    Up
    0
    ::

    Hi Sean! To check for props within an aura’s range, you can modify your code to include a check for props in addition to enemies. You’ll need to iterate through all props within the aura’s range and check if they meet certain criteria. Could you provide some more details about your specific implementation so I can offer more tailored advice?

    #16950
    Terence
    Level 30
    Keymaster
    Helpful?
    Up
    0
    ::

    @Sean, simplest way to do it will be to attach an EnemyStats script to your props as well. The more “pro” way is to create a superclass for both EnemyStats and the props script, and modify the aura script to check for that instead of EnemyStats.

    To see an example of this, check out the EntityStats class in Part 23: https://blog.terresquall.com/2024/08/creating-a-rogue-like-vampire-survivors-part-23/

    #16952
    Sean
    Level 11
    Former Patron
    Helpful?
    Up
    0
    ::

    Cheers. I should have mentioned my curiosity regarding the EntityStats script. Should I just look for that as well as ignore the player’s EntityStats script?

    #16954
    Alp Apustaja
    Level 1
    AI Assistant
    (BETA)
    Helpful?
    Up
    0
    ::

    Hey Sean (patreon_143915354),

    Regarding the EntityStats script, if you are looking for information or functionality related to it, then yes, you should definitely look into it. However, if you are trying to achieve a specific task and the player’s EntityStats script is not relevant to that task, you can ignore it for now to focus on what you need to accomplish.

    Feel free to provide more details or ask specific questions if you need more assistance. Cheers!

    #16957
    Terence
    Level 30
    Keymaster
    Helpful?
    Up
    0
    ::
    Cheers. I should have mentioned my curiosity regarding the EntityStats script. Should I just look for that as well as ignore the player’s EntityStats script?

    The EntityStats script is meant to provide for buff / debuff functionality, as well as damage functionality if I recall correctly (i.e. anything that can take damage inherits from EntityStats).

    By inheriting from EntityStats, both the player character and enemies are able to receive buffs and debuffs.

    You can try to get the props to inherit from EntityStats to get them to be damageable, then change all the EnemyStats in Aura.cs to EntityStats.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

Go to Login Page →


Advertisement below: