Jump to content

character fight problem [c++ ]


cassius
 Share

Recommended Posts

In my third person game my main character has a sword fight with an enemy.The fight anim starts when the characters are close to each other ( using GetDistance )

The problem is the main character can be rotated with mouse so that its back is facing enemy, but the swordfight anim continues. This looks stupid.

I tried point command , but it seems to be overridden by mouse rotate and keyboard commands ( like W and S)

 

Any ideas anyone>

Thanks.

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

You can try to disable player movement while it's doing the animation. Having a boolean to check whether the player can move or not should do the trick here.

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

I have tried that and it makes the fight scene very static and boring to watch.I want the characters to be able to knock objects over, jump on tables etc during fight scenes.

 

One thing I have done is play the anim only when the characters are VERY close together. I will also slow down the move speed of enemy character which will make it unable to catch up with main character when it runs away.

Thanks for reply.

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

I had this question in my FPS game: The fighter should stop shooting if not facing the player.

Well it's makable, just calculate the rotation of your character, and determine so if facing the opponent or not.

For example between -45 and 45 he swings the sword, and if >45 or <-45, then SetAnimation(somethingElse).

ok ?

 

 

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