Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 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 The-Game-Master · Jul 26, 2015 at 08:57 PM · fpsfirstpersoncontrollerjetpackfirstpersonshooter

Help with jetpack script

I'm trying to add a jetpack to my (Standard) FirstPersonController script. However, I've found no way that seems to work. I tried doing it with the Rigidbody component, but then my player would seemingly bounce around on the ground. Then I used this code:

         if (Input.GetKey (KeyCode.LeftAlt)) {
             PlayerVelocity = PlayerVelocity + UpForce; 
         }
         if (PlayerVelocity > 0 && !Input.GetKey (KeyCode.LeftAlt)) {
             PlayerVelocity = PlayerVelocity / 8;
         }
         transform.position = new Vector3 (transform.position.x, transform.position.y + PlayerVelocity, transform.position.z);

It worked, but it would randomly drop me and then keep going up. I finally tried this:

                 controller.Move (transform.up * UpForce);

But it was to no avail. I can't seem to get a jetpack to work. Does anyone have any ideas? By the way, the script is attatched to my FirstPersonController prefab. Also, the "controller" variable was assigned.

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

Answer by w212ds · Jul 27, 2015 at 04:48 AM

You should research before you ask a question. Check this:https://www.youtube.com/watch?v=OIPpU7_RNVM Also provide more information is this game 2D or 3D?

Comment
Add comment · Show 3 · 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 The-Game-Master · Jul 27, 2015 at 04:47 PM 0
Share

$$anonymous$$y apologies, I should have made myself more clear. I am using the standard First Person Controller. This is a 3D First Person Shooter game. Also, thank you for the link. I googled it, but never found that.

avatar image The-Game-Master · Jul 27, 2015 at 05:39 PM 0
Share

I appreciate the video, but it was made for unity 4. I am using unity 5, so there is no Character$$anonymous$$otor script (which all of these videos depend on.)

avatar image Gurekam-Dhillon The-Game-Master · Feb 26, 2016 at 06:39 PM 0
Share

Same problem with me, no motor script .-. So, have you found a fix?

Also, sorry for necro posting.

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

23 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Cursor Not Centered 0 Answers

Where do I start in unity, multiplayer spe 2 Answers

Can you change the speed of a raycast? 1 Answer

Play Audio from different Object 1 Answer

Pushing rigidbody with FPS Controller 3 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