Further to my last post, Disabling Forcefields on Power Regulator Destruction, today I have mostly finished up the forcefields for the interiors of the starship in the Soneria level of the independent video game I’m writing.
Player Weapon Impacts on Forcefield
There needed to be some minor revision done to some of the enemy health and enemy destruction scripts I’ve previously written. I decided that when the player’s weapon hits the forcefield, it should do something different than the typical explosion I’ve been using. Instead, I thought it would make sense if the forcefield were to absorb the energy from the player’s weapons and disperse it. To accomplish that, there were a few things I needed to do.
- Set up a collider trigger event to contain information about the player’s weapon impact on the forcefield and its location
- Create an animated texture that would give the impression that the weapon’s energy is being absorbed by the forcefield
- Instatiate the effect on impact
The effect is more or less done. In the image above we can see the forcefield, the 2 power regulators on either side (talk about an epic alien design flaw!) and an impact energy dispersion. There’s also another weapon about to hit almost the same spot. The lightning-looking thing is the energy dispersion happening. It starts off small and quickly spreads to cover a surface area and then fades out.
There’s still a bug that I’ll need to fix which has more to do with checkpoint respawning than the actual forcefield itself, but it is being impacted by the bug. I imagine I’ll fix that up tomorrow.
Animation of Forcefield Deactivation
The next thing I did today was create a short (about 1/2 second) animation clip for the disabling of the forcefield. The clip is simply it turning off and on in rapid succession until it finally stays off. Pretty simple to do and it helps to sell the idea a bit more.
The last thing that I did tonight was specify what would happen to the player in the event that they collided with either the power regulators or forcefield itself. Also pretty simple…. it kills the player.