Jump to content
cassius

wrong way round

Recommended Posts

I got crawler big model from workshop and in my program point it at main character

but it has its back to main character. Rotating it in code didn;t work. Can this be fixed in editor? its mdl format only.

Share this post


Link to post

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.

Share this post


Link to post

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);

Share this post


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.

Share this post


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);

Share this post


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.

Share this post


Link to post

Well that was hard work, just to get a character to face the right way.

Should be a rotate option in model editor.

 

I will not be buying any mdl only format characters in the meantime.

Share this post


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.

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...