Jump to content

characters lean forward [ c++]


cassius
 Share

Recommended Posts

I am using point and follow with enemy characters but when they get close to the camera/player they lean forward and seem to go downwards.

Can this be corrected in any way/

amd quad core 4 ghz / geforce 660 ti 2gb / win 10

Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++

Link to comment
Share on other sites

Doesn't Entity:Follow() / Entity:GoToPoint() automatically point the character on its Y-axis the direction it needs to move? Why use Entity:Point() at all? Might even cause a jitter? Have not tried it but using the two commands seem like there would be a potential conflict.

 

Edit-- or are you just using it to point the enemy at the character after it comes to rest after a Follow() as it seems to rotate the enemy away from the target?

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

no. Follow works without point but then the enemy walks backward.

It looks to me that the spot point points to is low down on the target character making enemie lean forward when very close.

amd quad core 4 ghz / geforce 660 ti 2gb / win 10

Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++

Link to comment
Share on other sites

no. Follow works without point but then the enemy walks backward.

When you place the enemy within the editor and select it, the character should be facing the same direction as the global positive Z-axis (blue arrow). If it is not (like the crawler model), then you must set the character angle in its properties panel or via code when you load the model. If you set character angle via the properties panel then you can also set the Physics Mode to 'Character Controller', the Collision Type to 'Character', and the mass. Once you do that, then save the model as a Prefab. Then either load the prefab by placing it in the Editor's scene or by code via Prefab:Load().

post-14-0-74662200-1465687805_thumb.jpg

Another way around that entire problem is to just load the FBX model into a modeling app or UU3D and rotate the model 180 degrees and save so it will be facing the right direction.

 

It looks to me that the spot point points to is low down on the target character making enemie lean forward when very close.

Yes I suspect it does since the point on the entity it is looking at would be at its feet, where the character's origin is located.

  • Upvote 1

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

The behavior is probably because the point they're looking to is below them. You probably only want the Y rotation of the model, so you can set the X and Z rotation to 0 using SetRotation.

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.

Link to comment
Share on other sites

ah. Thanks everyone. looks like if I set up character in editor then save it as prefab I can cu out a lot of coding. I didn't realize that characters could be prefabs.BIG mistake made over a long period of time.

amd quad core 4 ghz / geforce 660 ti 2gb / win 10

Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++

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