Jump to content

SetInput: jump parameter


george68
 Share

Recommended Posts

Hi,

I've set up a character controller as follows:

pControler = Pivot::Create();
pControler->SetPhysicsMode(Entity::CharacterPhysics);
pControler->SetMass(1.0);
pControler->SetPosition(pEntity->GetPosition(true));
pEntity->SetParent(pControler, true);
pEntity->SetPosition(0.0, getHeight(), 0.0);
pEntity->SetMass(0.0);

and the update world function is:

walk = (window->KeyDown(Key::Up) - window->KeyDown(Key::Down)) * 7.0;
if (window->KeyDown(Key::Shift))
{
	strafe = (window->KeyDown(Key::Right) - window->KeyDown(Key::Left)) * 2.5;
}
else
{
	if (window->KeyDown(Key::Right))
		angle += 2.0;
	if (window->KeyDown(Key::Left))
		angle -= 2.0;
}
jump = window->KeyHit(Key::Control) * 10.0;
pControler->SetInput(angle, walk, strafe, jump);

Everything works fine, unless I change I change the value from 10.0 to 20.0 in the following line:

jump = window->KeyHit(Key::Control) * 20.0;

Please watch the following video:

https://youtu.be/-ufOAnsDqSs

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...