- Home /
NullReferenceException: Object reference not set to an instance of an object
NullReferenceException: Object reference not set to an instance of an object Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.String cacheKeyName, System.Type[] cacheKeyTypes, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory) Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.Object[] args, System.String cacheKeyName, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory) Boo.Lang.Runtime.RuntimeServices.GetProperty (System.Object target, System.String name) UnityScript.Lang.UnityRuntimeServices.GetProperty (System.Object target, System.String name) CharackterKontrolle.Update () (at Assets/CharackterKontrolle.js:10)
Here is my script... what did i do wrong? Hier ist mein script... was habe ich falsch gemacht?
var gehen = 3.0; var laufen = 1.5; var DrehSpeed = 200.0;
function Update () {
var Rotation = Input.GetAxis("Horizontal")*DrehSpeed; transform.Rotate(0,Rotation*Time.delta.Time, 1);
var Speed = Input.GetAxis("Vertical")*gehen;
if(Input.GetKey("left shift")) {
Speed*=laufen;
}
var Kontrolle : CharacterController = GetComponent(CharacterController); var Vorwaerts = transform.TransformDirection(Vector3.forward); Kontrolle.SimpleMove(Vorwaerts*Speed);
, Ich }
This script is suppost to let my Player Character walk and turn...
Dieser script ist da um meinen Player Charackter gehen und drehen zu lassen...
Hello, It would be really amazing if somebody could tell me what I did wrong and how i could do it better...
Hallo, Es wäre wirklich Toll wenn mir jemand sagen könnte was ich falsch geamcht habe und wie ich das besser machen könnte...
I hope for a quick answer... Thank you!
Ich hoffe auf eine schnelle Antwort... Vielen Dank"
hmm, still doesnt workk, now I get this Error $$anonymous$$essage...
NullReferenceException: Object reference not set to an instance of an object Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.String cache$$anonymous$$eyName, System.Type[] cache$$anonymous$$eyTypes, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory) Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.Object[] args, System.String cache$$anonymous$$eyName, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory) Boo.Lang.Runtime.RuntimeServices.GetProperty (System.Object target, System.String name) UnityScript.Lang.UnityRuntimeServices.GetProperty (System.Object target, System.String name) Charackter$$anonymous$$ontrolle.Update () (at Assets/Charackter$$anonymous$$ontrolle.js:10)
The same one isnt it? well my character Controller now is with my gameobject... ; / hmmm
Hey, well I has my gameobject selected when I made a new Character Controller... isnt that the only thing I need to do?. If not please tell me how I can do that...
Sorry Im still "new" to Unity...
Thank You!
Well I was on my gameobject wehen I made a character Controller... isnt that the only thing I need to do, if not please tell me how I do that...
Sorry Im still "new" to unity ;D
Thank you
Edit your question or post comments. Don't respond to answers with new answers that aren't answers.
Answer by Ludiares.du · Sep 18, 2011 at 09:52 PM
Make sure you've got a character controller attached to the game object
Answer by Clunk · Sep 19, 2011 at 05:43 AM
Change Input.GetKey("Left Shift") to Input.GetKey(KeyCode.LeftShift);
Your answer
Follow this Question
Related Questions
What is wrong with my script? 1 Answer
Simple Script getting Errors. 1 Answer
When Is This Script Destroyed? 1 Answer
Have null errors 1 Answer
NullReferenceException Error 6 Answers