Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

wrong way round


Recommended Posts

Setting the character angle in the editor does not work when the character loaded in by code.

 

In fact it changed nothing in the editor as far as I could see.

I had this problem before, if i remember correctly, this should fix it:

 

self.entity:SetCharacterControllerAngle(180);

 

(or c++) model->SetCharacterControllerAngle(180);

Link to post

Nope. No luck.

I could fix this in 5 seconds in uu3d but its mdl format only.

 

It the barbarian character from darkness awakes.

Sorry, i forgot to tell you that you also need to add model->GetCharacterControllerAngle() where you set the angle with SetInput. This is how i'm doing it since i have a lot of models that are +180 as well.

 

Example:

 

model->SetInput(model_rotation.y + model->GetCharacterControllerAngle(), move_speed, 0, 0, false, 1, 0);

Link to post

Is model the actual character name or the name of its pivot physics controller?

In my example, model is an Entity.

 

Here's a brief example.

 

// Declared in App.h //
Entity* model = NULL;
Vec3 model_rotation;

// Loaded at start //
model = Model::Load("Models/model_name.mdl");
model->SetCharacterControllerAngle(180);
model_rotation = Vec3(0, 0, 0);


// In your loop //
float rot_speed = 0;

if (window->KeyDown(Key::Left))
{
 rot_speed = -1.5;
}
else if (window->KeyDown(Key::Right))
{
 rot_speed = 1.5;
}

if (window->KeyHit(Key::Escape))
{
 model->Release();
 return false;
}

model_rotation.y += rot_speed * Time::GetSpeed();

model->SetInput(model_rotation.y + model->GetCharacterControllerAngle(), 0, 0, 0, false, 1, 0);

 

 

If you're still having issues, send me the model and i'll test it.

Link to post

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.

Facebook Twitter Youtube Github Steam
×
×
  • Create New...