gd,ld: some LD and some bug fixing that didn't fix the bugs
This commit is contained in:
@ -73,7 +73,7 @@ public partial class WeaponSystem : RigidBody3D
|
||||
_weaponState.SendEvent("plant");
|
||||
Freeze = true;
|
||||
GlobalPosition = _plantLocation;
|
||||
PlayerDashLocation = _plantLocation + _plantNormal * 0.1f;
|
||||
PlayerDashLocation = ComputeDashLocation(_plantLocation, _plantNormal);
|
||||
LookAt(GlobalTransform.Origin + _plantNormal, Vector3.Up, true);
|
||||
}
|
||||
|
||||
@ -84,6 +84,11 @@ public partial class WeaponSystem : RigidBody3D
|
||||
Freeze = true;
|
||||
}
|
||||
|
||||
private Vector3 ComputeDashLocation(Vector3 collisionLocation, Vector3 collisionNormal)
|
||||
{
|
||||
return collisionLocation + collisionNormal * 0.2f;
|
||||
}
|
||||
|
||||
public override void _IntegrateForces(PhysicsDirectBodyState3D state)
|
||||
{
|
||||
base._IntegrateForces(state);
|
||||
@ -92,7 +97,7 @@ public partial class WeaponSystem : RigidBody3D
|
||||
{
|
||||
_plantLocation = state.GetContactLocalPosition(0);
|
||||
_plantNormal = state.GetContactLocalNormal(0);
|
||||
PlayerDashLocation = _plantLocation + _plantNormal * 0.1f;
|
||||
PlayerDashLocation = ComputeDashLocation(_plantLocation, _plantNormal);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user