Jump to content

Recommended Posts

Posted

Hi Josh,

 

I'm trying to create a CharacterController Object and spawn a character dynamically in code, but having some trouble. (C++)

 

Is the below code correct?

 

 

playerEntity = Model::Load("Models/Characters/Barbarian/Barbarian.mdl");

CharacterController *controller = CharacterController::Create(playerEntity, 1.6F, kPlayerHeight, 0.5F, 45.0F);

playerEntity->SetMass(10);
controller->Release();

I load the level an turn on physics debugging but there is no collision shape. If I replace the CharacterController Line to

 

playerEntity->SetPhysicsMode(Entity::CharacterPhysics);

 

I do get a collision cylinder, but I don't think that's the right way.

 

Any pointers would be great! (excuse the pun =) ).

trindieprod.png?dl=0spacer.png?dl=0steam-icon.png?dl=0twitter-icon.png?dl=0spacer.png?dl=0
Posted

I didn't know there was a character controller available yet. Did you find a documentation page of it?

 

Maybe that's why I got stuck as well. I couldn't find a page of it either.

Using Leadwerks Professional Edition (Beta), mainly using C++.

Windows 10 / Linux Mint, Visual Studio 2017. GPU: NVidia GeForce GTX970, CPU: Intel i7 7700K @ 4.20 GHz

Previously known as Evayr.

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.

×
×
  • Create New...