Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

how to fix my error CS1061

$
0
0
hi i need to fix my error CS1061 pls help me //: the error is: Assets\Grounded.cs(9,29): error CS1061: 'GameObject' does not contain a definition for 'Transform' and no accessible extension method 'Transform' accepting a first argument of type 'GameObject' could be found (are you missing a using directive or an assembly reference?) and here is the code : using System.Collections; using System.Collections.Generic; using UnityEngine; public class Grounded : MonoBehaviour { GameObject Player; // Start is called before the first frame update void Start() { Player = gameObject.Transform.parent.gameObject; } // Update is called once per frame void Update() { } private void OnCollisonEnter2D(Collision2D collision) { if (collision.collider.tag == "Ground"){ Player.GetComponent().isGrounded = true; } } private void OnCollisionExit2D(Collision2D collision) { if (collision.collider.tag == "Ground") { Player.GetComponent().isGrounded = false; } } }

Viewing all articles
Browse latest Browse all 2891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>