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
1
Question by user-6023 (google) · Oct 31, 2010 at 08:11 PM · gravityfirst-person-controller

How do you make gravity for the First Person Controller

I made a First Person Controller,that was set to a height to drop from. Instead of falling the character stayed in the air at the height. It wouldn't go up or down when coming to hills. How do I create a gravity field for this character?

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

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by IJM · Oct 31, 2010 at 08:48 PM

You need to add a Rigidbody Component to your GameObject:

Select your First Person Controller GameObject from the Hierarchy.

In the Menubar go to Component->Physics->Rigidbody

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 Adrian Lopez · Oct 31, 2010 at 09:43 PM 1
Share

A rigidbody won't work unless asker first removes the character controller from the object in question.

avatar image
1

Answer by JesusChristChangedMe · Nov 04, 2010 at 11:12 PM

use this script on this site for basic player movement. click here to go to the site.

hope this helps with your player's movement.

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 JesusChristChangedMe · Oct 31, 2010 at 09:22 PM

well instead of a rigidbody i would put a CharacterController on your player.

its right next to the rigidbody. Component->Phisics->CharacterController

but there should be a first person controller prefab already Pre-Put into unity. just search it in the project bar.

Comment
Add comment · Show 9 · 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 Adrian Lopez · Oct 31, 2010 at 09:36 PM 1
Share

As you can see from his question. he's already using a first person controller.

avatar image JesusChristChangedMe · Oct 31, 2010 at 10:04 PM 1
Share

he said he made one. unity already comes with a pre-made one.

avatar image Adrian Lopez · Oct 31, 2010 at 10:26 PM 0
Share

I don't think the pre-made controller handles gravity, does it?

avatar image JesusChristChangedMe · Oct 31, 2010 at 10:54 PM 1
Share

yeah it does accually, not only do the scripts it comes with apply gravity to it but so does the character controller. rigidbody is used to make things act like they are bouncing around or falling apart and is used to put on gameObjects. character controller works with lots of moving around scripts. the pre-put in FPS comes with FPSwalker and mouse look scripts.

avatar image Adrian Lopez · Nov 01, 2010 at 12:59 AM 1
Share

@UnityScripter: Hmm... you're right: the First Person Controller prefab does indeed handle gravity for you, and the standard CharacterController's Simple$$anonymous$$ove() function does so as well. The problem with the Simple$$anonymous$$ove() function is that you can't do things like jumps through it since it ignores any velocities along the Y axis. As for the First Person Controller pre-fab, maybe asker wants something different?

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

No one has followed this question yet.

Related Questions

Affecting FPS controller/Character Motor physics with game object 1 Answer

FPS's Capsule Collider doesn't work when the FPS is translated. 0 Answers

Attaching First Person Controller to Kinematic Rigidbody 1 Answer

walking inside curved surface 1 Answer

gravity doesnt seem to effect my first person controller....help! 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