Skip to content

Fix setMotionType with Physics instances #16880

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/dev/core/src/Physics/v2/characterController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ export class PhysicsCharacterController {
*/
public dynamicFriction = 1;
/**
* cosine value of slop angle that can be climbed
* cosine value of slope angle that can be climbed
* computed as `Math.cos(Math.PI * (angleInDegree / 180.0));`
* default 0.5 (value for a 60deg angle)
*/
Expand Down
4 changes: 2 additions & 2 deletions packages/dev/core/src/Physics/v2/physicsBody.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,10 @@ export class PhysicsBody {
/**
* Sets the motion type of the physics body. Can be STATIC, DYNAMIC, or ANIMATED.
* @param motionType - The motion type to set.
* @param instanceIndex - If this body is instanced, the index of the instance to set the motion type for.
* @param instanceIndex - If this body is instanced, the index of the instance to set the motion type for. If body is instanced but instanceIndex is undefined, the motion type will be set for all instances.
*/
public setMotionType(motionType: PhysicsMotionType, instanceIndex?: number) {
this.disableSync = motionType == PhysicsMotionType.STATIC;
this.disableSync = instanceIndex === undefined && motionType == PhysicsMotionType.STATIC;
this._physicsPlugin.setMotionType(this, motionType, instanceIndex);
}

Expand Down