This commit is contained in:
2026-06-04 12:42:00 +07:00
parent 5526341041
commit f70082a350
14 changed files with 697 additions and 447 deletions

View File

@@ -1,4 +1,6 @@
using Invector.vCharacterController;
using Invector.vCharacterController;
using OnlyScove.Scripts;
namespace Invector.vShooter
{
[vClassHeader("Shooter Lock-On")]
@@ -30,9 +32,10 @@ namespace Invector.vShooter
protected override void LockOnInput()
{
if (tpInput.tpCamera == null || tpInput.cc == null) return;
if (tpInput == null || tpInput.tpCamera == null || tpInput.cc == null || inputReader == null) return;
// lock the camera into a target, if there is any around
if (lockOnInput.GetButtonDown() && !tpInput.cc.customAction)
if (inputReader.ConsumeToggleView() && !tpInput.cc.customAction)
{
isLockingOn = !isLockingOn;
LockOn(isLockingOn);
@@ -43,10 +46,11 @@ namespace Invector.vShooter
isLockingOn = false;
LockOn(false);
}
// choose to use lock-on with strafe of free movement
if (strafeWhileLockOn && !tpInput.cc.locomotionType.Equals(vThirdPersonMotor.LocomotionType.OnlyStrafe))
{
if (shooterMelee.isAimingByInput || strafeWhileLockOn && isLockingOn && tpInput.tpCamera.lockTarget != null)
if (shooterMelee.isAimingByInput || (strafeWhileLockOn && isLockingOn && tpInput.tpCamera.lockTarget != null))
tpInput.cc.lockInStrafe = true;
else
tpInput.cc.lockInStrafe = false;