Set actor location and rotation without disabling physics?

Hey guys,

It seems that it’s impossible to change the location and rotation of an actor whose components are simulating physics. In my case, I have a skeletal mesh component as the root. When I try to alter the location and/or rotation, it will only work if physics simulation is disabled for the mesh component.

This is true even with SetWorldLocationAndRotationNoPhysics on the component, which is described as being a method that does not affect physics, as well as TeleportTo on the actor itself.

Any ideas?

#PrimitiveComponent

/**
	 *	Set the position of all bodies in this component.
	 *	If a SkeletalMeshComponent, the root body will be placed at the desired position, and the same delta is applied to all other bodies.
	 *
	 *	@param	NewPos		New position for the body
	 */
	virtual void SetAllPhysicsPosition(FVector NewPos);
	
	/**
	 *	Set the rotation of all bodies in this component.
	 *	If a SkeletalMeshComponent, the root body will be changed to the desired orientation, and the same delta is applied to all other bodies.
	 *
	 *	@param NewRot	New orienatation for the body
	 */
	virtual void SetAllPhysicsRotation(FRotator NewRot);

#Usage

Mesh->SetAllPhysicsPosition

or

SkeletalMeshComponent->SetAllPhysicsPosition

#:)

Rama

Hi ,

I’m actually working on a fix for this right now and hope to have something for 4.5

I’ve just submitted something for this. It hasn’t been tested by QA yet but it works for me :slight_smile:

Here’s the git link:
https://github.com/EpicGames/UnrealEngine/commit/541d2cabd2af95dbaf113057e4919c00c08164af

while you are at it Ori dont forget this one!

:slight_smile:

PrimitiveComponent::GetPhysicsLocation()

https://github.com/EpicGames/UnrealEngine/pull/281

Hey guys… what happened to the implementation of GetPhysicsLocation? The git link above no longer works…
I am in need of getting the position and rotatien of a physics-enabled object.

Rama. i love you!)