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
2
Question by Karsnen_2 · Nov 23, 2012 at 08:23 PM · c#collisionrigidbodyios

[Solved] Is it okay if we change transform.position on a kinematic rigid body which also does not use Gravity?

Hello Devs,

I am in a position to use a rigidbody collider on a GObject. The rigidbody is just for namesake hence it won't be using any Gravity and it will be kinematic. Here on this GObject I am using two functions constantly such as

 this.transform.rotation = Quaternion.Lerp(this.transform.rotation, Angle, Time.deltaTime/2);

and one like this -

 this.transform.position = new Vector3(idealPos.x,(Target.transform.position.y + 40),idealPos.y);



Is it okay to use in on a rigidbody. I would like to stress again that the purpose of a rigidbody is just for the collider which is used for triggering events.

Thank you,

regards,

Karsnen.

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

Answer by Montraydavis · Nov 23, 2012 at 08:59 PM

The only physics involved in transform.position is setting the position, so yes, this is perfectly fine.

Pretty much anything in the game can have it's position set to (x,y,z)--regardless of rigidbodies, colliders, etc.

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 Karsnen_2 · Nov 23, 2012 at 09:55 PM 0
Share

Thank you.

avatar image
2

Answer by Owen-Reynolds · Nov 23, 2012 at 09:44 PM

The big warning about rigid bodies and "external" motion (changing `transform.position` yourself) is that it will often break physics. Setting velocity or using AddForce lets physics perform the movement. It can then see two things are going to collide, and bounce them properly.

Just changing position causes the physics to suddenly see overlapping objects. It might blast them apart, or let them overlap, or give a tiny push that looks almost like a proper bounce (so slowly changing position sort-of works on an RB.)

IMHO, `isKinematic` is designed for exactly what you're using it for -- making a no-physics-motion/effects object technically count as one, for purposes of joints or causing collisions.

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 Karsnen_2 · Nov 23, 2012 at 09:55 PM 0
Share

Thank you.

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

12 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

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

How to create a damped harmonic oscillation? 1 Answer

Why are my projectiles facing the wrong way? 1 Answer

Need help with scripting bug fix. pleease 0 Answers

Performance Question on Kinematic Rigidbodies 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