Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 blenderbros1 · Jul 21, 2012 at 02:02 AM · jump

please i beg of you help!!!!!!!!!!!!!!!

ok i am a noob i never done scripting but i have been following the tornadotwins i am doing the worm game tut....i am at the part when you make the movment for the worm ..... this is where i had to add a character controller to it beofroe scripting but here is the script thay gave me to add to the worm

   var speed = 6.0;
   var rotateSpeed = 3.0;
 
   function Update()
   {
       var controller : CharacterController = GetComponent(CharacterController); 
 
       //Rotate on Y 
       transform.Rotate(0, Input.GetAxis ("Horizontal") * rotateSpeed, 0); 
 
       //Move forward/back 
       var forward = transform.TransformDirection(Vector3.forward); 
       var curSpeed = speed * Input.GetAxis ("Vertical");
 
       controller.SimpleMove(forward * curSpeed); 
  }
  @script RequireComponent(CharacterController)


ok now every thing works but the jumping part i know there is no jumping action in this script but in the tuts thay made the worm jump can someone please just tell me what to add and make shure it works please i just want to make it jump i need it to jump up in the air when i press space like a normal game if you please answer for me and i did go back and i checked if i missed any thing in the videos i did not

Comment
Add comment · Show 3
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 whydoidoit · Jul 21, 2012 at 08:36 PM 0
Share

Any chance you could edit the title of this question to be in line with the FAQ? This is a knowledge base and the title of the question should be something someone else might one day search for.

avatar image blenderbros1 · Jul 22, 2012 at 09:29 PM 0
Share

um how lol i am a noob rember please give me the insruction on how to add this to the location you are refuring to

avatar image blenderbros1 · Jul 22, 2012 at 09:42 PM 0
Share

nver$$anonymous$$d i went into the forms and made a thread about it

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Ingen · Jul 21, 2012 at 09:11 PM

Hallo! I think this can help you

http://answers.unity3d.com/questions/12911/what-are-the-syntax-differences-in-c-and-javascrip.html

and over all

http://forum.unity3d.com/threads/113937-Getting-Started-with-Coding-for-Unity

http://www.unifycommunity.com/wiki/index.php?title=Tutorials

regards

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 Dee Va · Jul 21, 2012 at 02:16 AM

 var jumpSpeed: float = 5.0;
 var speed: float = 6.0;
 var rotateSpeed: float = 60.0;
 var gravity: float = 10.0; // gravity acceleration
 
 private var vSpeed: float = 0; // store vertical speed in a separate variable
 
 function Update ()
 {
     var controller : CharacterController = GetComponent(CharacterController);
     // Rotate around y - axis
     transform.Rotate(0, Input.GetAxis ("Horizontal") * rotateSpeed * Time.deltaTime, 0);
     // Move forward / backward
     var curSpeed = speed * Input.GetAxis ("Vertical");
     var moveDir = transform.forward * curSpeed;
     // Jump code
     if (controller.isGrounded){ // if character is grounded...
         vSpeed = 0; // its vert speed is zero
         if (Input.GetButtonDown("Jump"))
         { // but if jump pressed, set it to jumpSpeed
             vSpeed = jumpSpeed;
         }
     }
     // apply gravity acceleration
     vSpeed -= gravity * Time.deltaTime;
     moveDir.y = vSpeed; // include vSpeed in  moveDir
     // moveDir * Time.deltaTime is the displacement since last frame
     controller.Move(moveDir * Time.deltaTime);
 }
Comment
Add comment · Show 4 · 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 blenderbros1 · Jul 21, 2012 at 02:28 AM 0
Share

um i like the idea of it but when i jump its like a teleport lol is that onpurpose of what lol i need a jump not a teleport in the air

avatar image Dee Va · Jul 21, 2012 at 02:41 PM 0
Share

What teleport?? you mean your player Staying long time in air? is that so decrease the Jump speed or increase the Gravity... Hope it Helped :D

avatar image blenderbros1 · Jul 21, 2012 at 07:36 PM 0
Share

i mean when i press the jump button insted of a jump its like a super quick teleport in the air depending on the jump speed on like 10 he dissapres off the screen and falls down slow on 1 he just dose a super quick hop just try to inmagin like a super jump up its like it skips frames going up so you never can see a smooth jump just a smooth down lol

avatar image blenderbros1 · Jul 21, 2012 at 08:36 PM 0
Share

never $$anonymous$$d dude thanks i fixed it with the gravity thank you thank you!!!!!!!!!!!!! ok i relly want to learn how you learnd to scrpit like that i mean how long did it take i just want to be able to creat basic scripts like this one we are talking about i kinda understand it becuse i just keep looking at the script but do you have any suggetstions any website you went to any thing i want to get into this stuff and i do know how to spell its just when i type fast i miss some letters and stuff cuz i am about to go out lol so if you answer i will get back to you soon thank you dude ..

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

Multiple Cars not working 1 Answer

Targetting error please help 0 Answers

Increase Jump Through Mouse Clicks? 1 Answer

A node in a childnode? 1 Answer

Need help with my script. 2 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