// Use this for initialization private void Start() { if (target == null) { GameObject player = GameObject.FindGameObjectWithTag(TagsAndLayers.PLAYER); target = player.transform; characterController = player.GetComponent <CombinedController>(); } zOffset = (transform.position - target.position).z; transform.parent = null; }
// Use this for initialization void Start() { try { parentRB = GetComponentInParent <Rigidbody2D>(); player = GetComponentInParent <CombinedController>(); pickup = player.ItemHoldingTransform; prevFacing = player.GetFacingDirection(); } catch { } }
protected void Start() { player = GameObject.FindGameObjectWithTag(TagsAndLayers.PLAYER); characterController = player.GetComponent <CombinedController>(); }