void Start() { motor = GetComponent <CreatureMotor>(); gravity = -(2 * maxJumpHeight) / Mathf.Pow(timeToJumpApex, 2); maxJumpVelocity = Mathf.Abs(gravity * timeToJumpApex); minJumpVelocity = Mathf.Sqrt(2 * Mathf.Abs(gravity) * minJumpHeight); }
void Start() { creatureMotor = GetComponent <CreatureMotor>(); creatureAI = GetComponent <CreatureAI>(); behavior = creatureAI.creature.creatureBehavior; creatureHealth = creatureAI.creature.creatureHealth; }
public void moveCreature() { if (InventoryController.instance.getEquippedCreature() != null) { CreatureMotor equippedCreature = InventoryController.instance.getEquippedCreature().GetComponent <CreatureMotor>(); Ray ray = mainCamera.ScreenPointToRay(Input.mousePosition); RaycastHit hitPoint; if (Physics.Raycast(ray, out hitPoint)) { equippedCreature.moveToPoint(hitPoint.point); } } }