When tackling my approach towards I decided to avoid physics completely when absorbing the characters because it was causing too many issues with the skeletal mesh and I felt that perusing the physics method was not worth the result.
Instead of using a negative radial impulse to pull enemies towards the player which requires physics to work correctly, I decided to use a launch character node that launched the enemy towards the players location. This function was being updated rapidly so that the launch motion is controlled smoothly at small amounts rather than being launched with slower updates which would result in a jerky movement.
During testing the absorb ability I discovered that when the player absorbed an enemy the mesh would prevent the player from moving normal without causing a collision with the absorbed mesh. I realised that a hit event was being triggered because the landing animation was being played when the player began to move. This animation is usually played when the player lands on the ground which is triggered by a hit event so I knew that the mesh must be causing a hit a event to the player.
To solve this issue, I set the mesh so that it would disable collision when the enemy had been absorbed. When the player ejects the enemy the collision on the mesh is enabled so that the player can collide with the enemy again.
Above shows two different enemies being absorbed and ejected successfully. The main issues with the system at the moment is that the enemies do not stay on the spline path so that they can be launched in front or behind the player. Another issue with the enemy is that the when it is being absorbed the enemy continues running through their behaviour tree. This is an issue because if the enemy had been absorbed the BFF would continue to fire projectiles while inside of Belly which would cause is a problem.
To prevent the enemies from continuing to execute the behaviour tree while being absorbed I created a timer that checks if the enemy has been absorbed. This timer changes a blackboard variable when the enemy is being absorbed which will change interrupt the behaviour tree which stops the enemy from progressing through the behaviour tree. I applied this method to all of the enemies in the game so that they would all act the same when being absorbed. In the future, I plan to add an animation to the enemies when they are being absorbed so that they are not just playing a walk or idle animation when being absorbed.
One of the issues with the BFF is that I need it to walk along the spline path when it patrols from both of it’s target/patrol points. This could be done manually, however, any changes made to the spline would involve moving every target point which will make this process lengthy. To solve this issue, I created a tool that allows the target points to snap to the spline paths using the construction script (footage of this tool can be seen in the clip above). The tool finds the nearest spline point and moves the target point along the Y axis so that the Y axis matches that of the spline. This system allows the BFF to move to valid target points that are only on the spline path. Matching this with a blueprint that updates the location of the BFF so that it is limited to the spline for movement will result in movement that is locked to the spline along the Y axis.
When the enemies are being absorbed I wanted to add an animation to the suction state so that you can easily identify when enemies are being absorbed. I created a basic rotating loop for the BFF and I feel that it fits well with the absorb ability. I will have to create separate animations for the different enemy types.
Rees, O (2019). Suction system launching the enemy towards the player. [offline]. [Accessed 18/03/2019].
Rees, O (2019). Function for absorbing characters using launch nodes. [offline]. [Accessed 18/03/2019].
Rees, O (2019). Bug that was causing the player to hit the ground which played the landed animation when the enemy was absorbed. [offline]. [Accessed 18/03/2019].
Rees, O (2019). Suction, absorbing and ejecting enemies working correctly on the test enemy. [offline]. [Accessed 18/03/2019].
Rees, O (2019). Testing the suction on the BFF. [offline]. [Accessed 18/03/2019].
Rees, O (2019). Timer that checks if the enemy is being absorbed. [offline]. [Accessed 18/03/2019].
Rees, O (2019). Behaviour tree that checks if the enemy is being absorbed. [offline]. [Accessed 18/03/2019].
Rees, O (2019). Testing the suction ability on all of the characters. [offline]. [Accessed 18/03/2019].
Rees, O (2019). Locking target points to a spline path. [offline]. [Accessed 18/03/2019].
Rees, O (2019). Target point icon. [offline]. [Accessed 18/03/2019].
Rees, O (2019). Target point construction script. [offline]. [Accessed 18/03/2019].
Rees, O (2019). Rough BFF being absorbed animation. [offline]. [Accessed 18/03/2019].
Rees, O (2019). BFF with the being absorbed animation. [offline]. [Accessed 18/03/2019].