Skip to content

Commit

Permalink
nightly 1.8.0.0 (1/14) pt.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ipodtouch0218 committed Jan 15, 2024
1 parent e2848fc commit 5a689a9
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions Assets/Scripts/Entity/EntityMover.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using Fusion;
using NSMB.Tiles;
using NSMB.Utils;
using NSMB.Entities.Player;

[SimulationBehaviour]
public class EntityMover : NetworkBehaviour, IBeforeTick, IAfterTick, IAfterAllTicks, IRemotePrefabCreated {
Expand Down Expand Up @@ -280,10 +279,6 @@ private Vector2 CollideAndSlide(Vector2 raycastPos, Vector2 raycastVel, bool gra

Vector2 positionToSurfacePoint = (direction * hit.distance) + (alignedDirection * Skin);

if (TryGetComponent(out PlayerController _)) {
Debug.DrawRay(positionToSurfacePoint, hit.normal, Color.red);
}

// Started inside an object
if (hit.distance <= 0) {
RaycastHit2D stuckHit = Runner.GetPhysicsScene2D().Raycast(raycastPos, (hit.point - raycastPos), Mathf.Max(size.x, size.y), filter);
Expand All @@ -309,6 +304,7 @@ private Vector2 CollideAndSlide(Vector2 raycastPos, Vector2 raycastVel, bool gra
if (Vector2.Dot(positionToSurfacePoint, hit.normal) > 0) {
// Hit normal pushing us away from the wall
Vector2 offset = (Vector2) Vector3.Project(positionToSurfacePoint, hit.normal);
// Maybe the offset shouldnt be based on the normal???

if (LockX) {
offset.x = 0;
Expand Down

0 comments on commit 5a689a9

Please sign in to comment.