private void FixedUpdate()
{
if (ProMouse.LeftButton.IsPressed && grapplingRope.Grappling)
{
grappleHolder.rotation = Quaternion.Lerp(grappleHolder.rotation, Quaternion.LookRotation(-(grappleHolder.position - _hit)), rotationSmooth * Time.fixedDeltaTime);
var distance = Vector3.Distance(player.transform.position, _hit);
if (!(distance >= minPhysicsDistance) || !(distance <= maxPhysicsDistance)) return;
// I want delay at right here. I want to activate other things after half second. Thanks for help
player.playerRigidBody.velocity += pullForce * Time.fixedDeltaTime * yMultiplier * Mathf.Abs(_hit.y - player.transform.position.y) * (_hit - player.transform.position).normalized;
player.playerRigidBody.velocity += pushForce * Time.fixedDeltaTime * player.transform.forward;
}
else
{
grappleHolder.localRotation = Quaternion.Lerp(grappleHolder.localRotation, Quaternion.Euler(0, 0, 0), rotationSmooth * Time.fixedDeltaTime);
}
}
It’s not an optimal solution probably but still, here it goes.
Add a field to class as:
private float timer = 0f;
private void Update(){
timer += Time.deltaTime;
}
then in your FixedUpdate
if(timer >= yourWaitTimeHere) {
timer = 0f;
//do your thing here.
}
İt worked thank you.