Valks-Games/sankari

Enemy falls through one-way platform

valkyrienyanko opened this issue · 7 comments

Steps to Reproduce

  1. Add basic enemy to test level on top of one-way platform

image

  1. Play the test level
  2. Notice how the enemy falls through the platform when you load in the level
  3. Notice how after the player kills themselves the enemy does not fall through the one-way platform this time (weird)

Issue

Enemy falls through one-way platform

Expected

Enemy should not go through the one-way platform

Maybe if the custom IsNearGround function is replaced with the built in godot InOnFloor function would fix this? But wasn't the whole reason to get away from IsOnFloor because it likes to not output the correct value when on the floor (constantly switches between true and false when on the floor). If someone does use this function be sure to print / debug it to the console before using it.

Changing

public bool IsNearGround() => AreRaycastsColliding(RaycastsGround, "Ground");

to

public bool IsNearGround() => IsOnFloor();

did not fix this

image

Even doing this does not work, it's like they teleport through the one way platform on spawning in?

image

Seem to have found the issue. BasicEnemy gravity is set to 30000, lowering this to 3000 fixes this issue but poses another issue, the enemy now accelerates at lightning speed.

Why doesn't the player move super fast as well? The player velocity is only set to 1200?

Figured it out

image

It is because these are called in Player but not in BasicEnemy