Get 25% off your next order from the Unity Asset Store: YW86GYBU8S.
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
- This topic has 3 replies, 3 voices, and was last updated 10 months ago by
Terence.
-
AuthorPosts
-
December 27, 2024 at 3:35 pm #16940::
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
December 27, 2024 at 8:11 pm #16944::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?
December 28, 2024 at 1:25 pm #16950::@Sean, simplest way to do it will be to attach an
EnemyStatsscript to your props as well. The more “pro” way is to create a superclass for bothEnemyStatsand the props script, and modify the aura script to check for that instead ofEnemyStats.To see an example of this, check out the
EntityStatsclass in Part 23: https://blog.terresquall.com/2024/08/creating-a-rogue-like-vampire-survivors-part-23/December 28, 2024 at 1:49 pm #16952::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?
December 28, 2024 at 2:11 pm #16954::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!
December 28, 2024 at 3:57 pm #16957::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
EntityStatsscript 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 fromEntityStats).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
EntityStatsto get them to be damageable, then change all theEnemyStatsinAura.cstoEntityStats. -
AuthorPosts
- You must be logged in to reply to this topic.
Advertisement below:
Get 25% off your next order from the Unity Asset Store: YW86GYBU8S.