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 martin101 · Jan 01, 2015 at 10:59 AM · rigidbodyvelocitykinematicmoveposition

Move a rigidbody when Kinematic ??

I know this is pretty much very basic question and has been asked a lot of times.

I have a rigidBody which is acting weird when is moved by rigidBody.velocity

how can move this object when it is set to kinematic

Here is the information i have to move this body

 float h = CrossPlatformInputManager.GetAxis ("Horizontal");
 float v = CrossPlatformInputManager.GetAxis ("Vertical");

 Vector3 direction = new Vector3 (h, v, 0.0f);


when it wasnt kinematic i was using this which was acting weird

 rigidbody.velocity = direction * speed;

but this doesnt support kinematic bodies

Moveposition is also not working because it is limited to the values of h and v as long as i reach the limits of Joystick the body stops moving

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

Answer by martin101 · Jan 01, 2015 at 11:23 AM

well I am still using rigidbody.velocity with my rigidbody being non kinematic and solved the weird behaviour/movement of rigidbody by writing

 rigidbody.velocity = Vector3.zero;
 rigidbody.angularVelocity = Vector3.zero;

at the top of my Update method, with this i am applying vector3.zero to every frame thus by preventing unnecessary 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
2

Answer by asafsitner · Jan 01, 2015 at 11:07 AM

When the rigidbody is marked as Kinematic, it means it's supposed to be moved outside of the physics system.

Move it like any other non-physics Transform, in the Update method using Transform.Translate or Transform.position.

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 martin101 · Jan 01, 2015 at 11:10 AM 0
Share

i am trying to avoid transform.translate because of its teleport and bad collision detection qualities ( may be im wrong here ). and rigidbody.position isnt working and is having the same problem as $$anonymous$$oveposition i.e. its limited to the boundaries of my Joystick

avatar image
0

Answer by ozcomingfroo_unity · Oct 26, 2019 at 09:02 AM

I have Unity version 2018.3.13 and this allows me to move a Kinematic object with the velocity.

That being said, it was done in a 2D environment, so maybe 3D objects cannot have that

Edit: I am sorry , setting velocity for a Kinematic only works for 2D objects. I just tested with a 3D object and the result was as you expect. My fault

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

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

27 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

Related Questions

Kinematic RigidBody does not collide with Wall using MovePosition 2 Answers

Kinematic how to know rigidbody velocity vector? 1 Answer

Set velocity of kinematic rigidbody appropriately 1 Answer

Rigidbody.MovePosition was working perfectly, now completely frozen 0 Answers

Transferring velocity from kinematic to a rigid body 0 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