playMaker

Author Topic: Making a PlayMaker 3rd Person Character Controller  (Read 14339 times)

markfrancombe

  • Sr. Member
  • ****
  • Posts: 338
Making a PlayMaker 3rd Person Character Controller
« on: February 27, 2013, 04:23:32 AM »
Im sure Im going to have a lot of questions about this one.

First one is: To get me started,
Whats the correct way to get the keyboard controls for WASD- I could use Get Button Down and up, for each direction...
OR (what Im trying now) Get Axis Vector, storing the vector and sending it to Contoller Simple Move.
This works for Forward and Reverse, (W and S) but for left and right, I need to translate this into a rotate somehow...

I will also need to hook the same controls to the animations, and also want to differentiate between standing still and moving, so that a turn, while standing still can use a shuffle animation, and for jump too I can use a different animation when standing still or running.

Any help/hints however small would be appreciated, but Im convinced that building a controller myself is going to be the best way, Im struggling too much with trying to adjust pre-made controllers to suit MY needs...

Mark

Mr-Brett

  • Playmaker Newbie
  • *
  • Posts: 22
  • Not very technical Artist
    • Portfolio
Re: Making a PlayMaker 3rd Person Character Controller
« Reply #1 on: February 27, 2013, 04:44:07 AM »
This tutorial should help with most of what you need.

markfrancombe

  • Sr. Member
  • ****
  • Posts: 338
Re: Making a PlayMaker 3rd Person Character Controller
« Reply #2 on: February 27, 2013, 05:17:30 AM »
Thanks Mr Brett!
Working through it now, nice to see I was on the right track...

At 3.45 he doesnt mention WHAT KIND of variables he is storing, experimenting now...
Im guessing a float for the multiplier, a vector 3 for the vector, and Im really guessing that its a float again for the magnitude (Or is it a Bool as he mentions that its just for knowing if a key is held down or not?)

Any ideas?

Mr-Brett

  • Playmaker Newbie
  • *
  • Posts: 22
  • Not very technical Artist
    • Portfolio
Re: Making a PlayMaker 3rd Person Character Controller
« Reply #3 on: February 27, 2013, 05:31:27 AM »
It's a float, at 6:55 you see that the movement states are managed with a float compare which works from the magnitude.

markfrancombe

  • Sr. Member
  • ****
  • Posts: 338
Re: Making a PlayMaker 3rd Person Character Controller
« Reply #4 on: February 27, 2013, 05:45:26 AM »
Yes, by experimenting I discovered that these were the only variable types the field would accept anyway,

However, it doesnt work for me.. :( When he first presses play at 4:17
"that allows you to move around.."

It doesnt for me? The only thing Im doing different is that Im not use a cube but a character model (hoping to jump ahead soon ) Cant see why THAT would make a difference, but I guess I have to try with a cube now..
:(

mark

markfrancombe

  • Sr. Member
  • ****
  • Posts: 338
Re: Making a PlayMaker 3rd Person Character Controller
« Reply #5 on: February 27, 2013, 05:54:50 AM »
OK, now I tried with a cube EXACTLY same as him and no dice...

What could it be now?

Mr-Brett

  • Playmaker Newbie
  • *
  • Posts: 22
  • Not very technical Artist
    • Portfolio
Re: Making a PlayMaker 3rd Person Character Controller
« Reply #6 on: February 27, 2013, 05:57:55 AM »
Have you got a character controller assigned? You may need a character motor too, I'm not sure (I'm still pretty new playmaker and unity).

markfrancombe

  • Sr. Member
  • ****
  • Posts: 338
Re: Making a PlayMaker 3rd Person Character Controller
« Reply #7 on: February 27, 2013, 06:21:12 AM »
yes... both... although Im not totally sure what the character motor actually does!

Mr-Brett

  • Playmaker Newbie
  • *
  • Posts: 22
  • Not very technical Artist
    • Portfolio
Re: Making a PlayMaker 3rd Person Character Controller
« Reply #8 on: February 27, 2013, 07:48:56 AM »
Me neither.

I mostly copied the tutorial but I'm using first person so had to branch off a bit at some point. I don't think I can help any more... hopefully someone more knowledgeable will come along soon :)

markfrancombe

  • Sr. Member
  • ****
  • Posts: 338
Re: Making a PlayMaker 3rd Person Character Controller
« Reply #9 on: February 27, 2013, 08:07:00 AM »
OK I found one thing out.

On my float for PlayerMoveSpeed which is used as the multiplier on the Get Axis Vector, when I select it in the globals tab, I saw that the value for Float was 0. I chnaged it to 1 and now it works.. so it was feeding a value of 0.
So that makes sense, and now works.
(I corrected the other float, the one for PlayerAxisMagnitude too, to be on the safe side, although I haven't got there on the YouTube tutorial yet.

But now I have another issue,
the turn keys A and D are not turning the character, he does NOT rotate, just slides (strafes) left and right.


EDIT: Should have continued with the tut, the next bit handles rotation, my guy is NOT rotating around his main transform however, but in a larger arc, maybe I can correct this somehow?
« Last Edit: February 27, 2013, 08:43:08 AM by markfrancombe »

Mr-Brett

  • Playmaker Newbie
  • *
  • Posts: 22
  • Not very technical Artist
    • Portfolio
Re: Making a PlayMaker 3rd Person Character Controller
« Reply #10 on: February 27, 2013, 10:09:35 AM »
Ah I've had issue with empty variables too, I keep debug ticked now so I can see what value the variables are feeding in without having to check them manually.

The rotation could be that something is set to world instead of self?

markfrancombe

  • Sr. Member
  • ****
  • Posts: 338
Re: Making a PlayMaker 3rd Person Character Controller
« Reply #11 on: February 28, 2013, 04:03:39 PM »
As per usual Im updating this partly for my own record.
I fixed the rotation thing, by veering away from the original video.
In the movement Get Axis Vector, the tutorial had both Horizontal and Vertical Axix selected, whch I think is wrong, (maybe you dont notice if your avatar is a brick?)
Only Vertical should be selected here:
THEN in the rotate FSM, I had the Get Axis, with only Horizontal selected, THEN he only rotates around himself. So infact he wasnt rotating in a big arc, he was actually rotating AND strafing at the same time.

Now IM working on 2 things.

1. Jump: Gets stuck coming out of a jump, and stays on the last frame of the animation, sliding along... till I release all movement buttons, only THEN will he returns to Idle THEN can walk/run again How do I get him to return to the RUN animation after having done a jump?

2. Rotate on the spot. I want him to shuffle his feet when he is rotated when NOT moving. I have the animation, but can figure out how or what to use to spot if hes moving or not... seems a bit clunky to check individually whether W or S is being presed, if not then play animation when A and D are pressed, but .. I dunno.. maybe its ok?

CAn I use the Store Magnitude thingy for this? Seem to think thats what ts for actually..?

MArk


markfrancombe

  • Sr. Member
  • ****
  • Posts: 338
Jump not returning to previous animation (with VIDEO!)
« Reply #12 on: March 01, 2013, 08:36:26 AM »
Heres my jumping problem

https://www.dropbox.com/s/2wywy1u3my5nbvi/Jum%20to%20skid.mov

As you can see I have my guy walking running and turning, but when he jumps he doesn't return to the previous animation, whether it be walking or running.

He just slides on the last frame of the jump animation.
Do I have to make a variable that checks what the last animation BEFORE JUMP was and then explicitly run THAT animation? This seems like a clunky way to do it (not sure HOW to either)

I see that there is a mention on the Play Animation wiki page that theres a bit of bug regarding the Default Wrap Mode, could this be related? (I have of course tried setting the Jump to other things, like Clamp Forever.. to no avail...

MArk

GrandAlchemist

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Making a PlayMaker 3rd Person Character Controller
« Reply #13 on: April 01, 2014, 05:16:26 PM »
Did you ever figure out how to jump using a character controller? Having similar issues myself.