Jump to content

Model faces the wrong way when CharacterPhysics moves forward. [C++]


TheConceptBoy
 Share

Recommended Posts

Good day, everyone. The title is purposefully simplistic since when I goggled for this issue, few relevant posts popped up.

Currently I have a model of an enemy and it gets a PhysicsMode(Entity::CharacterPhysics) assigned to it. When the model moves forward using the input() commands, the character model is facing sideways. 

 

Now I can fix that in two ways: 

1) I can Create a Dummy Empty and set that to a character controller, then parent the model to the dummy and rotate it in local space.

2) Or I can rotate the model in the modeling software to face the right way.

 

My question is, is there a third option? Something in the properties or perhaps orientation function for making the model face the same forward direction as the forward movement of the character controller? I've scoped the docs for any appropriate functions but alas the top two solutions are the only ones I've found. Decided to ask just in case.

Link to comment
Share on other sites

I should mention that I'm not using the Editor to create the character controllers. I'm using C++ to loop through all the enemy models I placed in the level and create the Actors that way. 

 

EDIT:

well actually this also works even when I'm attaching the character controller in c++. Thanks. 

I do wonder if there is a C++ function for this, seeing how its in the editor and the editor has got to call some sort of a function.

Link to comment
Share on other sites

AND YES IT IS. IT'S IN THE DAMN ENGINE FILES, But it's NOT in the docs. 

        virtual void SetCharacterControllerAngle(const float angle);//lua
        virtual float GetCharacterControllerAngle();//lua

 

@Josh How come so much useful stuff is undocumented? Do you need help getting documentation for some functions in the docs. A well designed Documentation that's easy to traverse and search is the hallmark of an engine for new arrivals. Game Maker Studio is perhaps an example of, what I'd say the worlds best documentation for their engine. 80% of what I've learned, I've discovered in their help by typing in a keyword like "draw" and I'd get ALL draw related functions.

 

Seriously, if you need help documenting some stuff, perhaps we can contribute on our spare time?

  • Like 3
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...