![]() Note: MovePosition is intended for use with kinematic rigidbodies. Is called during the FixedUpdate callback. For this reason, it is recommended that it Update will result in the last call being used. Physics update therefore calling this method repeatedly without waiting for the next physics It is important to understand that the actual position change will only occur during the next It is recommended that you use this for relatively small distance movements only. ![]() If the rigidbody is kinematic then any collisions won't affect the rigidbody itself and will only affect any other dynamic colliders.ĢD rigidbodies have a fixed limit on how fast they can move therefore attempting to move large distances over short time-scales can result in the rigidbody not reaching the specified position during the next physics update. This also means that if the colliders produce a collision then it will affect the rigidbody movement and potentially stop it from reaching the specified position during the next physics update. If using the second code, assign the object with the Rigidbody2D to the rb slot in the Editor. You must assign the object to move to the obj slot in the Editor. they will produce collisions and/or triggers. I suggest using the second code and moving the Rigidbody if you want to be able to detect collison later on. This causes the object to rapidly move from the existing position, through the world, to the specified position.īecause this feature allows a rigidbody to be moved rapidly to the specified position through the world, any colliders attached to the rigidbody will react as expected i.e. During the move, neither gravity or linear drag will affect the body. ![]() Moves the rigidbody to the specified position by calculating the appropriate linear velocity required to move the rigidbody to that position during the next physics update.
0 Comments
Leave a Reply. |