Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • 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 nejilee · Oct 04, 2011 at 06:01 PM · movearound

move around script help me

var speed = 3.0; var rotateSpeed = 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)

this work but not work good pleas help me

Comment
Add comment · Show 2
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 asafsitner · Oct 04, 2011 at 06:22 PM 0
Share

I took the liberty to re-paste your code and format it. Otherwise it'd be impossible to understand. In the future, please remember to format your code properly. Just select the text and click the 'code' button in the post toolbar (that's the one with binary on it) or press ctrl+$$anonymous$$.

 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 : Vector3 = transform.TransformDirection(Vector3.forward);
     var curSpeed : float = speed * Input.GetAxis ("Vertical");
     controller.Simple$$anonymous$$ove(forward * curSpeed);
 } 
 
 @script RequireComponent(CharacterController)

Now, what exactly isn't working for you? Does it work at all? Any weird behaviors?

I see that you forgot to declare the type of the variables (I fixed that), but other than that it's nearly identical to the sample script from the documentation. Is there anything else? Can you describe what's not working with more detail please? $$anonymous$$aybe paste the errors from the console as well?

avatar image finanshow · Apr 15, 2013 at 12:49 PM 0
Share

Hi there, once I run the script, the sphere drop down automatically. But I can't control it move forward or backward via keyboard.

4 Replies

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

Answer by clunk47 · Dec 16, 2012 at 09:12 PM

Here is the Unity FPS Tutorial

Comment
Add comment · 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
0

Answer by nejilee · Oct 05, 2011 at 06:40 PM

i repair all errors but leave my project can you tell me where can i find a site for fps game tutorial

Comment
Add comment · Show 1 · 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 clunk47 · Dec 16, 2012 at 09:11 PM 1
Share

Convert this to a comment.

avatar image
0

Answer by Hassam1957234 · Dec 16, 2012 at 08:44 PM

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 : Vector3 = transform.TransformDirection(Vector3.forward);
 var curSpeed : float = speed * Input.GetAxis ("Vertical");
 controller.SimpleMove(forward * curSpeed);

}

@script RequireComponent(CharacterController)

Comment
Add comment · 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
0

Answer by jmc50 · Aug 06, 2016 at 05:51 AM

My move around script didn't work I copy and past from tornatotwins. but thanks for trying My java might not be updated for this

Comment
Add comment · 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

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.

Follow this Question

Answers Answers and Comments

7 People are following this question.

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

Related Questions

Make an object move toward a point, but stop when it hits another object? 3 Answers

How to make an AI that moves around 1 Answer

How do I make the nose/whole of my spaceship move? 2 Answers

Camera move belong a certain path 1 Answer

How to get a ai to drive to a raycast 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