Jump to content

Character Script Prevent Sliding


photo

Recommended Posts

Posted

Hello,

 

I am using the built in Unigine high level script character system.

Trying to configure in such a way that it continues to handle damping and acceleration, but does NOT become affected by gravity!

I've created a simple test scene which (hopefully) has no other dependencies besides the attached file.

 

When you run this program, a character should appear on a sloped object. The character will slide down the slope without input. This is undesirable. When input is provided he should move, and accelerate. When input is removed, decceleration until halt should occur. Further sliding due to gravity should not occur.

 

Any help in achieving this effect using the Character system would be greatly appreciated :(

 

 

 

Thanks,

Michael

Sliding Character.zip

Posted

We will test this problem, please, stand by.

Posted

We will test this problem, please, stand by.

Hello,

 

I have another question about the character system.

 

Right now, when the character is not moving, but is turning, there is a delay between the rotation of the character's transform and the turning animation. This causes a disconnect between the rotation of the character and the direction of the character's forward direction. I would like the character to face forward as the character turns. I've been having trouble locating where this logic is located in script/config files.

 

 

 

Thanks,

Michael

Posted

We will test this problem, please, stand by.

 

Any update on solving this problem?

Posted

Alexander is already involved in your problem, please, stand by.

Posted
Any update on solving this problem?

The problem is solved. In the next update it will be available. Note that only nonphysical player is being protected from sliding.

Posted

The problem is solved. In the next update it will be available. Note that only nonphysical player is being protected from sliding.

 

Okay, sounds good! :) Am I correct in assuming that a nonphysical player does not handle decceleration/acceleration?

 

 

Finally, when can I expect the next update? And how will I be notified / how do I access it? By e-mail?

 

 

Thanks,

Michael

  • 2 weeks later...
Posted

Okay, so I moved over to the new SDK, but the sliding problem remains? I have set the physical flag in the agent.character to a value of 0.

Posted

Okay, so I moved over to the new SDK, but the sliding problem remains? I have set the physical flag in the agent.character to a value of 0.

 

Bump.

 

I am calling

character.actor.setPhysical(0);

as well as setting the .character file xml attribute to be 0.

 

Neither of these prevent the sliding?

 

Were your changes included in the latest SDK?

  • 2 weeks later...
Posted

I have similar problem, I configured a camera system very similar to actor_01.cpp sample as follows:

 

void CameraSystem::_setup_players() {


float min_theta		= 5.0f;
float max_theta		= 80.0f;
float velocity		= 40.0f;
float acceleration	= 7.0f;
float distance		= 40.0f;

p_actor = new PlayerActor();
p_actor.setMinThetaAngle(min_theta);
p_actor.setMaxThetaAngle(max_theta);
p_actor.setJumping(0.0f);
p_actor.setMaxVelocity(velocity);
p_actor.setMinVelocity(velocity);
p_actor.setDamping(5.0f);
p_actor.setAcceleration(10.0f);
p_actor.setPhysicalMass(-1.0f); //no mass
p_actor.setPhysical(0); //no physical
p_actor.setCollider(0); //disables collision test
p_actor.setPosition(vec3(0.0f,0.0f,0.0f));
p_actor.setThetaAngle(0.0f);
p_actor.setPhiAngle(-90.0f);


p_persecutor = new PlayerPersecutor();
p_persecutor.setControls(0);
p_persecutor.setAnchor(vec3_z);
p_persecutor.setMinDistance(distance);
p_persecutor.setMaxDistance(distance);
p_persecutor.setDistance(distance);
p_persecutor.setMinThetaAngle(min_theta);
p_persecutor.setMaxThetaAngle(max_theta);
p_persecutor.setThetaAngle(10.0f);
p_persecutor.setTarget(p_actor);
engine.game.setPlayer(p_persecutor);
}

 

I want my actor never get affected by gravity or collisions (actually it falls when is outside a base plane) like if it was a ghost :)

  • 3 months later...
Posted

I have added gravity flag for bodies.

You can get body from PlayerActor and disable gravity.

There is collision flag and collision mask in PlayerActor for collision handling.

Posted

I have added gravity flag for bodies.

You can get body from PlayerActor and disable gravity.

There is collision flag and collision mask in PlayerActor for collision handling.

 

Thank you very much, Frustum! I've been waiting for this fix for some time.

Posted

I have added gravity flag for bodies.

You can get body from PlayerActor and disable gravity.

There is collision flag and collision mask in PlayerActor for collision handling.

Thank you! :)

×
×
  • Create New...