Enemy Projectiles - Kelsey 11/8/23
We wanted the enemies to shoot the correct elemental projectile orbs based on which elemental monster they were. Part of this functionality was already done with the player projectile orb as there is a mechanic for changing which element the player is shooting. They way that the player's mechanic is done is by casting the player character from the orb to the third person character we use as the player. From there the third person character as an Enum that is switched on to change the color of certain variables with in the orb. The trail and sphere can have their colors changed from certain parameters that are set in their correlating materials and ns effects.
I tried to use this same functionality with the enemy projectiles but was running into issues. The first was that I had to create a child of the player projectile elemental orb instead of working on a child of the basic player projectile orb because it wasn't allow the same functionality to work. The second was that I had to find a different way to cast to the different enemies instead of getting the player character, this came with another issue of not being able to use the third person character's Enum to switch on the elemental Enum.
In order to be able to access the owner variable in the enemy projectile class I needed to set it in the enemy monster classes. So when overriding the attack function in each of the monster classes I had to set the owner. From there I can call the get owner function and get the class and use that to cast to the different enemy classes. This took away the need for the element Enum and instead I casted it to each of the different enemy classes. I then had to changed the current color to correlate with the monster element. In order to changed the trail and sphere I needed to set up the color and element parameters in the materials and the ns effect the same way it was done in the player projectile. After setting that up the enemy started shooting the correct color projectiles.
Get MystiMayhem
MystiMayhem
Mysti Mayhem is an action RPG where the player uses magic abilities to defeat monsters in different parts of her realm.
Status | In development |
Author | lotuslions |
Genre | Role Playing, Action |
Tags | 3D, Unreal Engine |
More posts
- Enhanced Input for Inventory -Kelsey 12/13/2023Dec 14, 2023
- Enemy Projectile Overlapping - Kelsey 12/06/2023Dec 07, 2023
- Fixing Enemy AI Aiming - Kelsey 11/29/2023Nov 30, 2023
- Player Model Animation Blueprint - Kelsey 11/15/2023Nov 15, 2023
- Enemy Death Animations -Kelsey 11/1/23Nov 01, 2023
- Enemy Defense Mechancis - Kelsey 10/13/2023Oct 14, 2023
- GPU Driver Crash - Kelsey 09/29/2023Sep 30, 2023
- Enemy AI Mechanics – Kelsey 09/20/2023Sep 21, 2023
- Unreal C++ Errors – Kelsey 09/15/2023Sep 15, 2023
Leave a comment
Log in with itch.io to leave a comment.