playMaker

Author Topic: Move Character spine with mouse? [SOLVED]  (Read 3489 times)

NvrEz

  • Playmaker Newbie
  • *
  • Posts: 6
    • View Profile
Move Character spine with mouse? [SOLVED]
« on: March 16, 2012, 01:25:44 PM »
Ok so I use a character. He is all animated and has his own controller. I just got playmaker and want to rotate the character spine with the mouse.

I have been at this for hours. Any tips on the process I should use?
« Last Edit: March 16, 2012, 08:00:11 PM by Alex Chouls »

justifun

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 228
    • View Profile
Re: Move Character spine with mouse?
« Reply #1 on: March 16, 2012, 02:07:54 PM »
Try using "get axis" and get the MouseX and MouseY axis (By Typing MouseX into the Axis name field), and save the values as variables, then use those variables to "rotate" the spine joint".

You might need to play around with the multiplier to get the right speed feeling.
« Last Edit: March 16, 2012, 02:10:16 PM by justifun »

NvrEz

  • Playmaker Newbie
  • *
  • Posts: 6
    • View Profile
Re: Move Character spine with mouse?
« Reply #2 on: March 16, 2012, 02:36:56 PM »
I imported the playmaker package thru the asset store today. where would i get the multiplayer demo?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3632
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Move Character spine with mouse?
« Reply #3 on: March 16, 2012, 03:08:44 PM »
If the bone is animated you probably need to rotate it in Late Update which is called after Update. So the animations run in Update and your Rotate action overrides the rotation in Late Update.

I've posted an updated Rotate action that has a Late Update option:
http://hutonggames.com/playmakerforum/index.php?topic=1226.0

Download the file and replace Rotate.cs in PlayMaker/Actions

Quote
where would i get the multiplayer demo?

There are a few networking samples to get you started in PlayMakerSamples/Network

The fourth sample has a couple of issues fixed here:
http://hutonggames.com/playmakerforum/index.php?topic=1156.0

Networking support is brand new, so stay tuned for more samples as well as support for Photon, which makes networking in Unity much easier!

NvrEz

  • Playmaker Newbie
  • *
  • Posts: 6
    • View Profile
Re: Move Character spine with mouse?
« Reply #4 on: March 16, 2012, 03:15:58 PM »
I'll definatley have alook when i get home later.

however I am struggling a little with how to get playmaker to do the rotate on late update.

Sorry if I am a little slow but I'm a artist guy trying to figure this out.

Thanks!

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3632
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Move Character spine with mouse?
« Reply #5 on: March 16, 2012, 03:48:47 PM »
Can you post a screenshot of what you have so far?

justifun's advice is good:

Use Get Axis with axis set to "Mouse X" and store in a float variable.
Use the variable in Rotate with Every Frame and Late Update both checked.


NvrEz

  • Playmaker Newbie
  • *
  • Posts: 6
    • View Profile
Re: Move Character spine with mouse?
« Reply #6 on: March 16, 2012, 04:52:13 PM »
ok so here is a pic of what i got not.
The FSM is attached to the spine that needs to be moved. Me<---Confused
Image attached

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3632
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Move Character spine with mouse?
« Reply #7 on: March 16, 2012, 05:13:17 PM »
A useful tip: Check Debug at the bottom of the State tab, and you can see the value of your variables at runtime.

You should always check your variable values to make sure they're what you expect.

EDIT: Also you could copy/paste this FSM onto a cube and test it... to eliminate the animation from the equation...
« Last Edit: March 16, 2012, 05:15:25 PM by Alex Chouls »

NvrEz

  • Playmaker Newbie
  • *
  • Posts: 6
    • View Profile
Re: Move Character spine with mouse?
« Reply #8 on: March 16, 2012, 06:05:26 PM »
Its actually working. The problem is the character is done with Mixamo animations. And when their scripts are on it stops the FSM from working.

Guess I'll work on that.

Thanks guys.