Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: createasaurus on February 24, 2014, 04:58:50 PM

Title: Camera Rig interfering with Get Axis Vector Relative To Main Camera? [SOLVED]
Post by: createasaurus on February 24, 2014, 04:58:50 PM
My joystick controls my character funny.  When the camera points one way, Left moves him left, Right moves him right.  When the camera points the opposite, Left moves him right, Right moves him left. 

I think my Camera Rig may be interfering with the Get Axis Vector Relative To Main Camera command?

My Main Camera position is 0,5,-10 and is grouped under an empty object at 0,0,0.  The Camera has a Look At target position 0,0,0.  I use Get Axis and Rotate to rotate the empty object / camera.  Thus the camera has the intended result of always looking at the origin as it rotates full circle around it.

My character uses Get Axis Vector and is Relative to Main Camera.

I did have trouble putting the Main Camera in the "Relative To" field from the Hierarchy.  So I made the camera rig a prefab, and pulled it into the "Relative to" from the Project folder.  Maybe this caused a problem?

My understanding is that with the axis vector being relative to main camera, my character should control a little less awkward.

I am having trouble pin pointing where my error is.
Thank you for your thoughts.
Title: Re: Camera Rig interfering with Get Axis Vector Relative To Main Camera?
Post by: Lane on February 24, 2014, 05:06:39 PM
What are you using for locomotion, to move the character?
Title: Re: Camera Rig interfering with Get Axis Vector Relative To Main Camera?
Post by: createasaurus on February 24, 2014, 06:12:33 PM
My FSM is exactly from the Playmaker video basic tutorial, Building a Third Person Controller.

Get Axis Vector
Horizontal Axis: Horizontal
Vertical Axis: Vertical
Multiplier: 1
Map to Plane: XZ
Relative to: Main Camera (from the Project, not Hierarchy)
Store Vector: Movement

Controller Simple Move
Game Object: Use Owner
Move Vector: Movement
Speed: Wals Speed
Space: World

Smooth Look At Direction
Game Object: Use Owner
Target Diretion: Movement
Min Magnitude: .1
Up Vector: None
Keep Vertical: Check
Speed: 5
Last Update: Check

 I am using a joystick and Get Axis Vector.  It is a capsule with a character controller.
Title: Re: Camera Rig interfering with Get Axis Vector Relative To Main Camera?
Post by: Lane on February 25, 2014, 10:36:29 AM
If your controls are backwards you can invert them in the Input Manager, check out Edit > Project Settings > Input... Under the Horizontal name just check the Invert box and L/R will be inverted.

You also cant use stuff from the Project Hierarchy to interact with the Scene Objects. If you want it to be relative to something then it first must exist in the scene and you must reference the exact object - not its reference that's stored in the Project hierarchy. Were you having trouble getting the Main Camera (from the scene) into the Relative To slot?
Title: Re: Camera Rig interfering with Get Axis Vector Relative To Main Camera?
Post by: createasaurus on February 25, 2014, 12:17:37 PM
Thank you Lane!
You also cant use stuff from the Project Hierarchy to interact with the Scene Objects. If you want it to be relative to something then it first must exist in the scene and you must reference the exact object - not its reference that's stored in the Project hierarchy.
This was the problem!  Now I have fixed it and it works.

Were you having trouble getting the Main Camera (from the scene) into the Relative To slot?
Yes, I was having trouble.  I still do not know why it originally wouldn't let me put Main Camera in the Relative To slot?  Regardless, I was somehow able to do it now.  Hooray!