Page MenuHomeFeedback Tracker

When Enabling Physics on Objects, They Will Fall Through Inclined Terrain
New, UrgentPublic

Description

On terrain that has an incline of what I estimate 10° or higher the object will fall through the terrain.

When throwing is added into the game officially, this will be required to be fixed before hand.

Details

Severity
Major
Resolution
Open
Reproducibility
Always
Operating System
Windows 7
Category
General
Additional Information

This is the code we are using to enable the dynamic rigid body on the objects and setting the velocity.

void ThrowItem(CallType type, ref ParamsReadContext ctx, ref PlayerIdentity sender, ref Object target)
{
	Param1< vector > data;
	if ( !ctx.Read( data ) ) return;

	if ( type == CallType.Server )
	{
		if ( target == NULL ) return;

		PlayerBase player = PlayerBase.Cast( SyncPlayerList.GetPlayerFromPID( sender.GetPlayerId() ) );
			
		if ( player == NULL ) return;

		player.ServerDropEntity( target );

		target.SetPosition( target.GetPosition() + Vector(0, 1, 0));

		target.CreateDynamicPhysics( PhxInteractionLayers.DYNAMICITEM );

		vector lookAt = Vector( data.param1[0] * 125, data.param1[1] * 150, data.param1[2] * 125 );

		dBodyApplyImpulse( target, lookAt );

		player.OnItemInHandsChanged();
	}
}

Event Timeline

Unknown Object (User) added a subscriber: Unknown Object (User).Apr 30 2019, 1:21 PM