im sort of new to this whole thing, decided to try to use some of the tutorials to get an idea.
So doing the roll-a-ball thing right now. finished most of it just having trouble with moving the ball. I don’t know how to set up my input command. Sure i got one from the asset store, but made no difference.
Earlier today i was working on the script for the game to get ball to roll, i had a few issues by i managed to get them fixed later. After i finished the scrip, the ball was supposed to move. When ever i try to play test it the console tells me that there is a problem on line 21. Now i am not sure what that problem is but ill post the message along with the scrip.
NullReferencEexception: object reference not set to an instance of an object.
Maybe a pair of experienced eyes will see more than I.
Looking at your code, the PlayerControler object needs a RigidBody component to move.
I believe its because you have used a lowercase “void start()” method. In c# methods are case sensitive. Unity will be looking to use “void Start()” to initialize your object. So your code that gets the Rigidbody component is likely not running.
Either that or there is no Rigidbody component attached to PlayerControler in the editor.
Ok, now i think i am getting to the root of the problem, which apparently is rb and ‘;’ being recognized as an unexpected symbol. This seems to prevent the whole script from running. I got a few ideas as to why this is happening and will try to fix it.
Thx for you help Mr.Jobot.
I found the error that was preventing my object to move. i mistyped the script for Rigidbody as private instead of public. it works now.
Its strange that private caused the problem as that should still be fine in the context of your code. Perhaps an illegal character was pasted in that caused the issue and it was fixed by removing it and typing public.
You may want to back track a few lessons if you’re an absolute beginner. There is a sample project available as well. This is the same scripting I used for this.
Is there any tutorials or assets to allow a non-biped 3rd person controller? Namely, I want a CAT to be the third person character. I chose Cu-Cat2 as the cat asset.
How would I make a 3rd person camera that would follow the animated cat around and allow the player to use the mouse and keyboard to control it?