playMaker

Author Topic: Mouse Look using Playmaker  (Read 6494 times)

MajorIdea

  • Full Member
  • ***
  • Posts: 131
Mouse Look using Playmaker
« on: February 13, 2014, 12:41:49 PM »
Is it possible to create an FSM that replicates MouseLook?

I've been stuck on this issue for ages now and tried to work around it. But now it's important that I have more control over how I turn my character so I figured I'd ask for help. MouseLook doesn't allow any control on the speed at which you turn or allows you to get the values inside it or pretty much anything. It does what it does and that's it.

I've tried to recreate it by getting the position values of the mouse but neither could I make it work as it should (values not centered with the screen) nor could I make it feel or work as the MouseLook (if I dragged the mouse cursor to the left I made the character rotate to the left, but it wont stop rotating when I stop dragging the mouse, only when I center the cursor).

Any help on this would be HUGELY appreciated!

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Mouse Look using Playmaker
« Reply #1 on: February 13, 2014, 12:59:56 PM »
This action should help you get values from the center of the screen.

Do you have an example of what kind of control scheme you're trying to make? I'm not sure what other values you might want from the Mouse Look script.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Mouse Look using Playmaker
« Reply #2 on: February 13, 2014, 11:49:35 PM »
Hi,

 This package should have what you need:

bye,

 Jean

MajorIdea

  • Full Member
  • ***
  • Posts: 131
Re: Mouse Look using Playmaker
« Reply #3 on: February 17, 2014, 10:32:43 AM »
Thanks guys. Those packages do solve part of the issue.

Basically it's for this project http://hutonggames.com/playmakerforum/index.php?topic=4178.0

I'm controlling the rotation of the player with MouseLook, but that gives me 1-1 control and no way to read off of it. I can't read the rotation to make the character roll a bit to the left/right when I drag the mouse to the left/right nor can I adjust the rotation aside from changing the sensitivity.

With get mouse position I can now read where the mouse is on the screen and use that to rotate the character, but unlike MouseLook if I drag the mouse to the left it will keep rotating the character to the left until I position the mouse on the center or right part of the screen. With MouseLook it only rotates when The mouse is being dragged.

That's the main issue. I can't find an action or think of a way of using playmaker to create that same result.  :-\

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Mouse Look using Playmaker
« Reply #4 on: February 17, 2014, 11:14:15 AM »
Hi,

 instead control a dummy, and then have your character watching this dummy.

 I do that all the time, do not control your final object, instead control a dummy and have more work done on top of that using some lerping and catching up and smoothing/exageration.

bye,

 Jean

MajorIdea

  • Full Member
  • ***
  • Posts: 131
Re: Mouse Look using Playmaker
« Reply #5 on: February 17, 2014, 11:53:26 AM »
Hi jean,

I've tried making a dummy system. I essentially made five dummies and positioned them in front of my character. One in the center, and the other four in the top/bottom/left/right corners, and then I had another one that read the Get Mouse Position and moved it to the appropriate dummy with a float compare. Not sure if that's the way you meant it, but this may be a way to go about it?

But it still doesn't address the fact that when I moved the dummy to the left by dragging the mouse to the left, it stayed there and kept turning. With MouseLook it would stop turning the moment I stopped dragging the mouse.

Am I missing something really obvious?  :-\
« Last Edit: February 17, 2014, 11:55:23 AM by MajorIdea »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Mouse Look using Playmaker
« Reply #6 on: February 17, 2014, 11:55:04 AM »
Hi,

 implement your own mouse up state and stop whatever catching you are doing. By simply leaving the state where do you the smooth following or catching up..

 One dummy should be enough tho...not sure I picture why you need so many.


bye,

 Jean

MajorIdea

  • Full Member
  • ***
  • Posts: 131
Re: Mouse Look using Playmaker
« Reply #7 on: February 17, 2014, 11:58:05 AM »
Is there such a thing in playmaker? I only see a Get Mouse Button Up.

redikann

  • Full Member
  • ***
  • Posts: 174
Re: Mouse Look using Playmaker
« Reply #8 on: February 17, 2014, 03:20:36 PM »
One thing Ive noticed with the mouselook actions is that you lose the ability to rotate your object deliberately thru the transform because the mouse is updating every frame I suppose. Like they have mentioned you could place the mouselook action on an empty object and then parent the (ex. camera) main object to it. Now say you did a 2 tier parenting system (ex.Camera Root (parent), Camera Controller, Camera (parented to Camera controller)) you could place your mouse action on the camera Controller and still go up to the root object and add extra rotation thru it's transform.
You can also make a separate FSM for each mouse axis using a "Get Axis" action and then create your functionality.

The "Get Axis Vector" is also extremely useful because you can declare only one axis if you want and place it into any world axis and then retrieve a vect3 if you need it. Then you could turn around and apply that vector to your world or local axis of your object.
« Last Edit: February 17, 2014, 03:50:37 PM by redikann »