So I have the basic MoveAround script form TornadoTwins. I apply it to my character, and i do have a CharacterController, but when i play the game, i can’t walk, i can only rotate, and it shows this in the Unity 3D console: NullReferenceException: Object reference not set to an instance of an object
MoveAround.Update () (at Assets/MyScripts/MoveAround.js:10)
Here’s the script:
var speed : float = 3.0;
var rotateSpeed : float = 3.0;
function Update (){
var controller : CharacterController = GetComponent.CharacterController
;
transform.Rotate(0,Input.GetAxis ("Horizontal") * rotateSpeed, 0);
var forward = transform.TransformDirection(Vector3.forward);
var curSpeed = speed * Input.GetAxis ("Vertical");
controller.SimpleMove(forward * curSpeed);
}
@script RequireComponent(CharacterController)
I have a great idea for a game, and i’m trying to realize it, i’m not a professional (obviously) so any help would be appreciated!
They do this one for free I think, however in their later tutorials they charge extortionate amounts for a crappy inventory system. @Minkais get away from their tutorials ASAP in my opinion.
– Nercoe@Nercoe Inventory systems are easy... I made one in like 3 hours? (it sounds long, but it works exactly how the oldies JRPG's did it with some cool features). they also sell waterfalls, which was probably made in 5 minutes with a particle system lol. @Minkais Get away from there tutorials, like nercoe said, they want you to buy things that anyone could make quite easily
– Fornoreason1000Thank you so much, seems like such a simple thing, but I'm not very good with scripting as you probably figured :D Still sort of learning it by myself, anyway, again thank you!
– MinkaisNercoe* You'll give people the wrong impression calling me necro ;)
– Nercoeyour welcome, please mark this answer as accepted by clicking on the tick icon. here are some real tutorials sources. http://www.3dbuzz.com/training/topic/unity http://unitygems.com/ http://www.youtube.com/watch?v=QMWhtKjUr10 http://www.burgzergarcade.com/
– Fornoreason1000