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 /
  • Help Room /
avatar image
0
Question by Lushlush · Nov 24, 2019 at 11:26 PM · rigidbodymoveposition

Rigidbody.MovePosition doesn't work on selective objects.

So I have a character model with a lot of children (Being arms, fingers, etc.) FBX import,

I have the following script attached to it:

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 
 [RequireComponent(typeof(Rigidbody))]
 
 public class TestRigidbody : MonoBehaviour
 {
 
     Rigidbody rb;
     Vector3 position;
 
     float runningSpeed;
     Vector3 playerMovement;
 
     // Use this for initialization
     void Start()
     {
         rb = this.GetComponent<Rigidbody>();
         runningSpeed = 2f;
     }
 
     // Update is called once per frame
     void FixedUpdate()
     {
             playerMovement = new Vector3(0f, 0f, 0.05f);
             rb.MovePosition(this.transform.position + playerMovement.normalized * runningSpeed * Time.deltaTime);
 
     }
 }

For some reason the character is stuck in it's position, despite the fact that in Debug.Logs, you see that the result of the parameter in MovePosition(param) produces a changing result. Adding this exact script to another object, like a simple cube Does make the cube move. Interestingly enough, transform.Translate() does work on BOTH the cube and the character model. However I need the physics system for what I am trying to do.

Does anybody know wow it is possible that the exact script works for 1 object but doesn't work on another object, when working with Rigidbody.MovePosition(), where as moving that object would work for both when working with transform.Translate()?

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
Best Answer

Answer by Lushlush · Nov 25, 2019 at 10:46 AM

This problem was solved by removing the CharacterController component from the character object.

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 goutham12 · Nov 25, 2019 at 10:05 AM

there might be few problems in your case. 1) may be your charcter doesn't have rigidbody. 2) Mass : if rigidbody exists may be the mass is higher so the force you are applying is not enough to move. 3) drag : check in your rigidbody properties what's the drag you are using. by default it is zero. 4) Constrains: check this portion alson in the inspector.

Actually you can reset the rigid body property.

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 Lushlush · Nov 25, 2019 at 10:36 AM 0
Share

The

 [RequireComponent(typeof(Rigidbody))]

Includes a rigid body with standard values. $$anonymous$$ine are: $$anonymous$$ass = 10, Drag = 0, angular drag = 0.05, Use gravity = true, Is$$anonymous$$inematic (tried both true and false)), Interpolation = None, Col Detection = Continues/Discrete (tried both), Constraints = (No constraints and restrain Freeze X & Z rotation, tried both).

$$anonymous$$y character model is about the same size as the standard cube, twice the height but thin. Although it has many children (50+).

It also has an animator and Character controller attached, though copying those over to the cube didn't prevent the cube from working with $$anonymous$$ovePosition()

Gravity does work on my character as disabling the collider results in the character falling through the level, yet it refuses to work with the Rigidbody.

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

229 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 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 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 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 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 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 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 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 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 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

rigidbody.MovePosition to rigidbody.velocity 0 Answers

Moving RigidBody Smoothly 0 Answers

Moving a cube with RigidBody. MovePostition, it randomly stops moving 0 Answers

Control speed of a rigidbody that move to a fixed distance 2 Answers

How to: rigidbody.MovePosition to player's position 2 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