Hey! I need help with my Colliable script! Plz help

Welcome to the forums. When sharing code, ensure you use code tags to allow the code’s formatting to remain intact, along with syntax highlighting that makes spotting issues much easier.

In this case, though, I can see that your issue is likely caused by your Start() method being misnamed “start”. Capitalization matters in C#, so ensure you’re entering things as intended and following conventions. “Start” gets called automatically by Unity, while “start” would not. That means that when you got to the Update being executed, your boxCollider variable would remain unset and is what’s causing the errors to flood your console as you try to access it 60 times a second.

If you’re using an IDE like Visual Studio, VS Code, Jetbrains Rider, or even Script Inspector from the Asset Store, your text editor may even spot issues like this for you:
8590984--1151794--upload_2022-11-16_11-57-42.png

1 Like