Question by
unity_funZrogAzAlyEg · Feb 03, 2021 at 11:37 AM ·
errorcodepage
Unity code showing as an error,Unity code showing as error
When I try and look and run my code in unity 2020.2.2f1, it shows up as the unity code being an error when I use visual studio. Any fixes?
,
screenshot-2.png
(90.2 kB)
Comment
Answer by GDGames0302 · Feb 03, 2021 at 01:19 PM
Hi. I'm not sure if this helps you, but I have a suggestion: You declared that rigidbody outside the class. Try declaring it in the class. public class PlayerMovement : MonoBehaviour{public RigidBody rb; void Start(){rb.useGravity = false;} void Update(){}}. Sometimes my code shows an error(it is underlined with red color) even if there are no errors. I fix this by closing and opening the script again.