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 /
This post has been wikified, any user with enough reputation can edit it.
avatar image
0
Question by shinodan · Apr 11, 2012 at 03:35 AM · movementjumpcontrolinair

In air movement troubles.

okay, been trying for3 hours, 4 in the morning, i lost my has wiped my big long explanation TWICE, but basically in a nutshell id really appreciate some help getting this code to allow in air movement.

 // Check for jump
 if ( character.isGrounded )
 {
     if ( !rotateJoystick.IsFingerDown() )
         canJump = true;
     
     
     if ( canJump && jumpjoystick.tapCount == 1 )
     {
         // Apply the current movement to launch velocity
     
         velocity = character.velocity;
         velocity.y = jumpSpeed;
     
         
         
         
         
         canJump = false;
     }
 }
Comment
Add comment · Show 1
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 AlucardJay · Apr 11, 2012 at 08:36 AM 1
Share

Just a tip : if you are writing in a browswer and it refreshes or you just lose all your text , try writing in a blank notepad First, then just copy-pasta to where you want to post it. I told my sister this also, she was always getting cranky at FB for this problem.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by bodec · Apr 11, 2012 at 04:19 AM

your if statement at the start is checking to make sure you are on the ground so before any of the rest of the code will work you have to be grounded.

Comment
Add comment · Show 8 · 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 bodec · Apr 11, 2012 at 04:20 AM 0
Share

would not allow me to edit but im assu$$anonymous$$g you are using the isGrounded like its used in common practice the the below collider is touching

avatar image AlucardJay · Apr 11, 2012 at 08:37 AM 0
Share

I think @bodeci has the right idea here, maybe add some Debug.Log 's in to see where the code is breaking. This should show you where in the code you are.

 // Check for jump
 if ( character.isGrounded )
 {
     if ( !rotateJoystick.IsFingerDown() )
     canJump = true;

     Debug.Log("isGrounded:canJump = " + canJump );
 }


 if ( canJump && jumpjoystick.tapCount == 1 )
 {
     // Apply the current movement to launch velocity
     velocity = character.velocity;
     velocity.y = jumpSpeed;

     canJump = false;

     Debug.Log("jumpjoystick:canJump = " + canJump);
 }
 
avatar image AlucardJay · Apr 12, 2012 at 10:42 AM 0
Share

the Debug.Log is giving an error? please copy the message from the console, and post a comment with this error as this can be very helpful in finding where it is breaking. I cannot see it being a null reference , as canJump is declared right before the Debug.Log print-in-console.

And Remember (this is I$$anonymous$$PORTANT , it keeps all the 'site users happy , and you won't get negative marks on your karma) Don't comment in answer boxes , Please.

Look straight under this message. to the right, under my name alucardj, there is a little box saying 'add new comment'. Click On This, then a window opens up where you can type. Post your error message here. Put ALL your Comments here. NEVER use the Answer box, that is the solid rule, ok. Thanks.

avatar image shinodan · Apr 12, 2012 at 10:51 AM 0
Share

I had no idea, apologies, too used to forums!

Assets/Standard Assets ($$anonymous$$obile)/Scripts/CameraRelativeControl.js(109,9): BCE0044: expecting EOF, found 'else'.

Is the error im getting.

avatar image AlucardJay · Apr 12, 2012 at 10:59 AM 0
Share

No worries , thought I would point that out so people wouldn't be unfriendly about it to you.

ok , in your code , what is at line 109 to 118 ?

At a guess , there is a mis-placed } somewhere , so the function is ter$$anonymous$$ating before the else statement is being reached.

You can post this as a comment, or, would it be possible to edit your original question at the top, delete your old code and paste in the full code you are using now? If the formatting and browser refresh is a problem , just comment =]

Show more comments

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

6 People are following this question.

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

Related Questions

How to make camera position relative to a specific target. 1 Answer

CharacerController not allowing mid-air movement 1 Answer

Disable movement control during jump 3 Answers

jump in air 0 Answers

In Air Movement 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