void Start() { //swordComponent = sword.GetComponent<Sword>(); resetZoneComponent = resetZone.GetComponent <ResetZone>(); headFollowComponent = headFollow.GetComponent <HeadFollow>(); currentScore = 0; multiplier = 1; scoreText.text = "0"; multiplierText.text = "1x"; }
public void SpawnWorm() { if (activeWorm == null) { activeWorm = Instantiate(wormPrefab, WormsPlaneManager.Instance.GameRootObject.transform.position + wormSpawnInitialYOffset, Quaternion.identity) as GameObject; HeadFollow wormHead = activeWorm.GetComponentInChildren <HeadFollow>(); Vector3 targetPostition = new Vector3(Camera.main.transform.position.x, wormHead.transform.position.y, Camera.main.transform.position.z); wormHead.GrowToPoint(WormsPlaneManager.Instance.GameRootObject.transform.position + wormSpawnFirstGrowthYOffset); //Debug.Log("Worm spawned at: " + activeWorm.transform.position); //Debug.Log("Worm spawned with rot: " + activeWorm.transform.rotation); //Debug.Log("Game ROOT Obj pos: " + WormsPlaneManager.Instance.GameRootObject.transform.position); } }
private void Start() { headScript = GameObject.Find("Character").GetComponent <HeadFollow>(); anim = transform.GetChild(0).GetComponent <Animator>(); }
void Start(){ wh = GameObject.FindGameObjectWithTag ("WeaponHandler").GetComponent<WeaponHandler> (); hf = GameObject.FindGameObjectWithTag ("MainCamera").GetComponent<HeadFollow> (); ml = GameObject.FindGameObjectWithTag ("MainCamera").GetComponent<SmoothMouseLook> (); }