private void Awake() { rb = this.GetComponent <Rigidbody>(); movementPipeline = new MovementPipeline <Rigidbody, PlayerMovement>(rb, this); behavioursRigidbody = new DefaultBehavioursRigidbody <PlayerMovement>(movementPipeline); behavioursRigidbody.ComposeBehaviours(RigibodyBehaviours.ChangeVelocity, RigibodyBehaviours.ClampVelocity); maxSpeedChange = maxAcceleration * Time.fixedDeltaTime; mainCamera = Camera.main; }
private void Start() { myTransformReference = transform; if (copyOffsetFromPosition) { offset = myTransformReference.position; } rb = GetComponent <Rigidbody>(); movementPipeline = new MovementPipeline <Rigidbody, FollowTarget>(rb, this); behavioursRigidbody = new DefaultBehavioursRigidbody <FollowTarget>(movementPipeline); behavioursRigidbody.ComposeBehaviours(RigibodyBehaviours.ChangeVelocity, RigibodyBehaviours.ClampVelocity); }