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 Rumannoodles · Oct 06, 2016 at 07:54 AM · unity 5fpsjump

Survival Shooter- How do I add FPS and Jump Option?

Hello, I'm new to new Unity, I have completed the survival shooter tutorial but I want to add fps and jump option. I have used the fps script from character but I keep getting error. I have attached the camera to a player but its not very efficient. How can I be able to add fps and jump function? Please help, thank you!

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by chillersanim · Oct 06, 2016 at 08:56 AM

Hello.

The fps script from character depends on other scripts from the same asset.
Make sure to import ALL content from that bundle.

For the jump function:
You can use the Input class to determine the pressed buttons.
If the button of your choosing is pressed, you can apply an upward force to the player rigidbody.
I would reccomend the Impulse mode and quite some force.
You need to try different force values in order to find one that fits for you.

Example:

 public float JumpForce;
 
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Space))
     {
         var rigid = this.gameObject.GetComponent<Rigidbody>();
         if (rigid != null)
         {
             rigid.AddForce(transform.up * JumpForce, ForceMode.Impulse);
         }
     }
 }

Note: It should work, but I haven't tested my code.
So if I made a mistake, please let me know.

Greetings
Chillersanim

Comment
Add comment · Show 2 · 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 Rumannoodles · Oct 06, 2016 at 10:51 PM 0
Share

I have added that to the player movement script given in tutorial and I have tried creating a separate jump script and the player still doesn't jump. No errors are showing up and for fps i get crossplatfor$$anonymous$$put errors? Do i need to import that asset as well? Thanks!

avatar image chillersanim Rumannoodles · Oct 07, 2016 at 05:20 AM 0
Share

Does your player have a rigidbody?
If so, is it set to kinematik?

avatar image
0

Answer by Rumannoodles · Oct 07, 2016 at 07:42 AM

Yes, I got it. Now stuck on jumping :/. Thanks for your awesome help!

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 chillersanim · Oct 07, 2016 at 08:47 AM 0
Share

Do you use the default FirstPerson player script?
It provides it's own jump function and does not work together with physics that well..

Otherwise, could you post a screenshot of your player gameobject (inspector setup) and your player code?

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Saving Depth buffer for VR Game on Unity - DROP IN FPS 1 Answer

Bouncy platforms/spring jump? 4 Answers

standard fps walking script makes me faster when jumping 0 Answers

Raycasting 1 Answer

Issues after updating to Unity 5 1 Answer


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