playMaker

Author Topic: Phase Through Enemies  (Read 1268 times)

EpicChowder 619

  • Playmaker Newbie
  • *
  • Posts: 13
Phase Through Enemies
« on: January 29, 2015, 10:15:28 AM »
I have a simple game where the player is the standard first person controller and they navigate through a maze. The enemies in the game are simple cubes that, when they collide with you, they reset the level. The problem comes when you, the player, aren't having any input. If you was to walk into the enemy , the game would reset but walk in front of them and stay still, and you simply phase through them, leaving you unharmed. With some levels where you need timing to avoid enemies, staying still and letting them walk through you is a huge problem.

Any advice?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Phase Through Enemies
« Reply #1 on: January 29, 2015, 10:18:27 AM »
Maintain a bool on the character to be True if the player is moving.

When the enemies collide with the player go into a state checking that bool, if it ever turns to True, kill the player. Otherwise, nothing happens, they leave the collision and return to normal.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D