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.
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.
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(); } }