Jump to content

class Pawn - some problems


photo

Recommended Posts

Hello

 

 

I build up some code onto the Unigine::character class, but had some strange problems to sync it over the network. Since some months there is a the new class Pawn which replaces the CharacterSmart class.

I switched to this class and made some simple synchronizations.

 

While multiple clients are connected to the server, pawns are moving right in all directions and turning is too synchronized well. But I can't get animations working.

In the samples is no sample with the pawn class and the code is on some parts not clear to me.

 

I used a PawnAnimated for the local player and for remote players I used PawnDummy.

 

 

PawnSynchronizer:

		// Create state "pawn position".
		SharedState state_pawn_position = network.createSharedState(shared_object_id,STATE_PAWN_POSITION);
		state_pawn_position.setUpdateInterval(50);
		state_pawn_position.setMaxHistorySize(20);
		state_pawn_position.setArray((
					pawn.getPosition(),
					pawn.getYaw(),
					pawn.getPitch(),
					pawn.getLinearVelocity(),
					pawn.getAngularVelocity()));
		shared_object.addSharedState(state_pawn_position);

		// Create state "pawn actions"
		SharedState state_pawn_actions = network.createSharedState(shared_object_id,STATE_PAWN_ACTIONS);
		state_pawn_actions.setUpdateInterval(50);
		state_pawn_actions.setMaxHistorySize(10);
		state_pawn_actions.setArray((
					pawn.isFiring(),
					pawn.isCrouching(),
					pawn.getMoveDirection()));

 

If I'm right everything needed to play a animation is sent over the network. But only the "crouch" effect is appearing randomly while moving. Is there something I'm missing?

Maybe is there an sample for this class?

 

 

Thanks a lot and for any hint I'm very thankfully!

Link to comment
×
×
  • Create New...