playMaker

Author Topic: Need my character to look at Direction AND look at Mouse!  (Read 3466 times)

smerf1

  • Playmaker Newbie
  • *
  • Posts: 4
Need my character to look at Direction AND look at Mouse!
« on: April 06, 2014, 04:34:27 AM »
Like a game on the PSN store Dead Nation. Now I've searched high and far for this, and only came across one page. But it was not correct, it only had the character look at direction.

Now I've tried to replicate this myself with Get Axis vector and Look at direction, and that works. But if I add another FSM and do the same except for change the inputs on the axis to Mouse X and Mouse Y. It won't work, either 1 of them plays, just one not both.

I need both to work simultaneously.

Is this possible to achieve?

smerf1

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Need my character to look at Direction AND look at Mouse!
« Reply #1 on: June 06, 2014, 05:28:00 AM »
Bump for justice

TrentSterling

  • Junior Playmaker
  • **
  • Posts: 89
  • Someday I'll make games!
    • My Blog
Re: Need my character to look at Direction AND look at Mouse!
« Reply #2 on: June 06, 2014, 02:57:57 PM »
I haven't played the game you're referring to- but if you have the camera working with GetAxis and player movement... And you just want to tweak the rotations with the mouse X and Y, why not simply add the results?

Get your base angle figured out first, then do something like rotation-add on the camera using the mouse X/Y.

EDIT: If you want to make it easier- and dont want to add using maths...

You said you had an FSM where the camera moved/rotated with the mouse.

You said you had an FSM where the camera moves with the player.

Great. Make it 2 objects, and parent them together so that your Player moves CameraPivot1. Now below that, CameraPivot2 can be modified by mouse movements. Tied together through heirarchy- the movements should combine.
« Last Edit: June 06, 2014, 03:02:30 PM by TrentSterling »

smerf1

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Need my character to look at Direction AND look at Mouse!
« Reply #3 on: June 06, 2014, 04:08:45 PM »
Hi thanks for the reply.

No the camera is only moving with the player, the camera does not rotate.
I basically want a Dual Stick shooter controls.

Here is a video of the game I mentioned
https://www.youtube.com/watch?v=-syxOHFqN0k

Although you cant see, the left stick (WASD) Is for moving and look at the way it is moving, the right stick (mouse) is for just look at direction or Aiming.


TrentSterling

  • Junior Playmaker
  • **
  • Posts: 89
  • Someday I'll make games!
    • My Blog
Re: Need my character to look at Direction AND look at Mouse!
« Reply #4 on: June 06, 2014, 04:22:39 PM »
Oh I see.


That tutorial series covers the movement you need.

If you want BOTH movements (Look at movementDir and look at mouseDir)- set 2 states. One for looking at the WASD direction. Then on mouse down, switch states to look at the mouse.

EDIT: I have a gamejam game that moves like this. I'll try to dig it up right now.

http://puu.sh/9hXgT/1a367f9171.png[/img]]

http://puu.sh/9hXih/e644811024.png[/img]]

http://puu.sh/9hXj4/21cc6f7665.png[/img]]

In my case- the character looked at the WASD direction, unless you held down the left mouse button. This went into an arrow firing mode, so the character then looks at the mouse. When you release the mouse button, the arrow object is created and we go back into the initial WASD direction state.
« Last Edit: June 06, 2014, 04:35:49 PM by TrentSterling »