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
1
Question by jihee_song · Aug 24, 2016 at 09:29 AM · c#rigidbodycolliderfalling-through-floor

My Objects are falling through the floor..

Hi, I'm making a 1:1 running game using unity. but if I start, the player object is falling through the floor. The floor and Player object have their colliders and rigid bodies. And I checked the gravity.. they're not triggers too. Also, the player is not kinematic. I don't know why it happened...

here's my code.

 public class Player : NetworkBehaviour {
     public Rigidbody rbody;
 
     private float inputH;
     private float inputV;
     
     void Start () {
         rbody = GetComponent<Rigidbody>();
         
     }
     
     void Update ()
     {
         if(!isLocalPlayer)
         {
             return;
         }
 
         inputH = Input.GetAxis("Horizontal");
         inputV = Input.GetAxis("Vertical");
 
         float moveX = inputH * 500f * Time.deltaTime;
         float moveY = 0f;
     float moveZ = inputV * 1000f * Time.deltaTime;
 
         rbody.velocity = new Vector3(moveX, moveY, moveZ);
     }
 }
 
 

my english is not really good, so you may can't understand my writing.. if so, tell me. i'll wait for your answer! :)

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 _Yash_ · Aug 24, 2016 at 09:24 AM 0
Share

are they both mesh colliders?

avatar image Rob2309 · Aug 24, 2016 at 06:39 PM 0
Share

$$anonymous$$ake sure that your objects are at least a tiny bit above your floor ins$$anonymous$$d of exactly ontop of it, otherwise they might fall through it. If that's not the reason I would try to change rbody.velocity = ... to rbody.AddForce(...)

avatar image FelixCabrita · Aug 24, 2016 at 08:00 PM 0
Share

Asegúrate de no tener el trigger activado puesto que al tener el RigidBody ocasiona que el objeto traspase el suelo.

0 Replies

· Add your reply
  • Sort: 

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

Distribute terrain in zones 3 Answers

How to make player collide with ground? 1 Answer

collider not collidinng with bottom of object 1 Answer

Why object goes sometimes through walls by adding force ? 2 Answers

Problem with rotating a rigidbody 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