playMaker

Author Topic: 3rd person shooter character Hero and creating a anim controller  (Read 10293 times)

colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
Hi, I have been playing around with the Hero model from the complete projects 3rd person shooter and trying to use this model and anim as a new character within the Stealth project although I am learning from mistakes as I go it is going very slowly.

I was able to swap to the DonePlayerAnimator and use the Playmaker FSM's to control the new character I recently added the ability to equip the gun or not and you can only shoot with the gun equipped.

some issues:

when shooting the players arm will go through walls but when gun is not used the player stops at the wall correctly.

I want the players arm not to go through the wall and could someone help with a suggestion please.


Thank you for you time

colpolstudios
« Last Edit: June 06, 2014, 04:57:45 PM by colpolstudios »

colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
Re: 3rd person shooter character Hero and creating a anim controller
« Reply #1 on: June 06, 2014, 04:59:18 PM »
updated features and help request

TrentSterling

  • Junior Playmaker
  • **
  • Posts: 89
  • Someday I'll make games!
    • My Blog
Re: 3rd person shooter character Hero and creating a anim controller
« Reply #2 on: June 06, 2014, 06:10:01 PM »
I haven't seen the model/anims mentioned, but you could use a raycast or trigger area to detect if a wall is directly in front of the player- and switch to an animation where the gun isn't being aimed.

I do something similar for when a player tries to run into a wall-play an animation where he stops running.

Otherwise you'll have to offset it somehow.

colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
« Last Edit: June 21, 2014, 02:31:17 PM by colpolstudios »

colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
Re: 3rd person shooter character Hero and creating a anim controller
« Reply #4 on: June 21, 2014, 02:41:21 PM »
Recent update:Work in progress

https://dl.dropboxusercontent.com/u/150707256/playmaker%20stealth%20new%20character%20WIP/testing%20only.html

I wish to improve on the shooting of the character so that I could aim at a target.

What would be the best way to setup something like this?

Ideally I want the target to be a set distance from the character always placed in front of the character even if he turns.

I want to be able to move the target to follow mouse movements.

I think a blend tree could be used with a speed of movement to trigger animations to show the player taking aim at the target.

Ideas and help most welcome

colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
Re: 3rd person shooter character Hero and creating a anim controller
« Reply #5 on: June 23, 2014, 05:22:34 PM »
updated again, but does anyone else have trouble closing the web player window?

colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
Re: 3rd person shooter character Hero and creating a anim controller
« Reply #6 on: June 26, 2014, 03:39:21 PM »
Hi I wonder could someone help me out a little?

I am using the 3rd person shooting c# script and am wondering if it would be possible with this script: https://app.box.com/s/43l73gsen7yeanj9ebde could I in some way activate a playmaker fsm to control a new animator for targeting the aim target.

my internet is so poor at present I cannot watch any online videos and the subject of building a anim controller requires watching a tutorial.

Could I use the information from the script to turn the main character to face the direction of the aim target?

note the character will only turn to face the target with the gun equipped and in use.

Possibly an easier way would be to just purchase a sneak from maximo and just use legacy animation, but would this effect the coding used?


colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
Re: 3rd person shooter character Hero and creating a anim controller
« Reply #7 on: July 04, 2014, 07:44:42 AM »
Hi i got a reply over on unity forums.

The ShooterGameCamera script that you linked to moves the AimTarget transform to where you're looking with the mouse.

To make your character moves its arms to point the weapon at the AimTarget, here are two choices:

1. Aim Blend: In your animator controller, create a 2D blend tree node. Blend between four animations: aim extreme upper left, upper right, lower left, and lower right. Use PlayMaker's Math actions to figure out how far up/down and left/right between the character's center and the AimTarget. Then use the Mecanim SetFloat action to set the two float values for the blend tree.

2. Aim IK: Use Final IK (or similar product) or Unity Pro's OnAnimatorIK() to procedurally move the arms into position.

The Aim Blend seems to be the best way, but I need help with this part.

 Use PlayMaker's Math actions to figure out how far up/down and left/right between the character's center and the AimTarget. Then use the Mecanim SetFloat action to set the two float values for the blend tree.

The characters center is spine 3 transform.

Only when shooting the character will face the aim target.

Im stumped help anyone please.
« Last Edit: July 08, 2014, 07:20:13 PM by colpolstudios »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: 3rd person shooter character Hero and creating a anim controller
« Reply #8 on: July 18, 2014, 08:04:04 AM »
Hi,

-- Have you studied the IK sample from the mecanim wiki page? it shows how to control arms and legs via IK, and it's likely a good starting point for you to aim. I would not choose yet another asset to work this out, until you are very confident what how Mecanim works, as well as how PlayMaker interacts with Mecanim. Tho Final IK is PURE GOLD!!!!

-- To blend, I would need an actual working sample of that kind of system, if you find one, let me know, and I'll port it to PlayMaker.

Bye,

 Jean

 

colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
Re: 3rd person shooter character Hero and creating a anim controller
« Reply #9 on: July 18, 2014, 08:21:55 AM »
Please post a link to the IK sample from the mecanim wiki page.

Yes in deed. I need to study how Mecanim works, as well as how PlayMaker interacts with Mecanim.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: 3rd person shooter character Hero and creating a anim controller
« Reply #10 on: July 21, 2014, 08:43:43 AM »
Hi,

 It is there, it's in the "demo" package, linked on the wiki page. I put the direct link here:

https://hutonggames.fogbugz.com/default.asp?pg=pgDownload&pgType=pgWikiAttachment&ixAttachment=715&sFileName=PlayMakerAnimatorDemos.unitypackage

but it won't be working if you don't follow the instructions, you need to also get a package from the asset store ( the base for all the scenes).

Unless I misunderstand your question?

 Bye,

 Jean

colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
Re: 3rd person shooter character Hero and creating a anim controller
« Reply #11 on: August 02, 2014, 09:48:48 AM »
Recent update:Work in progress

https://dl.dropboxusercontent.com/u/150707256/playmaker%20stealth%20new%20character%20WIP/testing%20only.html

My anim controller:



The character begins in the shooting pose, the character is not shooting he drops out of this pose when you hit play.

You only enter the shootstaight when you enable shooting "spacebar" to enable shooting.

You can walk or sneak in both modes Gun on / Gun off.

When shooting you follow the aim target.

What I am hoping to do is using PlayMaker's Math actions to figure out how far up/down and left/right between the character's center and the AimTarget.

Then use the Mecanim SetFloat action to set the two float values for the blend tree.

I think I can setup the blend tree within the shootstraight, however I am unsure if this the correct way to do this.

Help most welcome.

Please try out the new update:


https://dl.dropboxusercontent.com/u/150707256/playmaker%20stealth%20new%20character%20WIP/testing%20only.html