• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Minkais · May 01, 2013 at 10:17 AM · physicsoptimization

TornadoTwins MoveAround script not working

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!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Fornoreason1000 · May 01, 2013 at 11:28 AM

this script is not by the the tornado twins, (if you paid for it Get a refund!)

http://docs.unity3d.com/Documentation/ScriptReference/CharacterController.SimpleMove.html

your script doesn't work because controller is null. that's what Null Reference basically means. and the reasons it is null is because you are calling Character Controller as a method at line 5.

Line 5 where you declare controller should be:

 var controller : CharacterController = GetComponent(CharacterController);



Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Nercoe · May 01, 2013 at 11:32 AM 0
Share

They do this one for free I think, however in their later tutorials they charge extortionate amounts for a crappy inventory system. @$$anonymous$$inkais get away from their tutorials ASAP in my opinion.

avatar image Fornoreason1000 · May 01, 2013 at 11:38 AM 0
Share

@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 $$anonymous$$utes with a particle system lol. @$$anonymous$$inkais Get away from there tutorials, like nercoe said, they want you to buy things that anyone could make quite easily

avatar image Minkais · May 01, 2013 at 11:39 AM 0
Share

Thank 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!

avatar image Nercoe · May 01, 2013 at 11:39 AM 0
Share

Nercoe* You'll give people the wrong impression calling me necro ;)

avatar image Fornoreason1000 · May 01, 2013 at 11:45 AM 0
Share

your 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=Q$$anonymous$$Wht$$anonymous$$jUr10

http://www.burgzergarcade.com/

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

14 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Static collider as a child of a rigidbody 1 Answer

How to optimize my program,which has MANY COLLISIONS(PHYSICS). 0 Answers

Countdown little help...! 1 Answer

My framerate on iPhone is low, should I switch to 2D? 1 Answer

Character Controller's performance for massive groups 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges