playMaker

Author Topic: Camera Rig interfering with Get Axis Vector Relative To Main Camera? [SOLVED]  (Read 812 times)

createasaurus

  • Full Member
  • ***
  • Posts: 133
    • View Profile
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.
« Last Edit: February 25, 2014, 10:17:56 AM by createasaurus »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2484
  • Yup.
    • View Profile
    • Cleverous
Re: Camera Rig interfering with Get Axis Vector Relative To Main Camera?
« Reply #1 on: February 24, 2014, 03:06:39 PM »
What are you using for locomotion, to move the character?

createasaurus

  • Full Member
  • ***
  • Posts: 133
    • View Profile
Re: Camera Rig interfering with Get Axis Vector Relative To Main Camera?
« Reply #2 on: February 24, 2014, 04: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.
« Last Edit: February 24, 2014, 05:39:48 PM by createasaurus »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2484
  • Yup.
    • View Profile
    • Cleverous
Re: Camera Rig interfering with Get Axis Vector Relative To Main Camera?
« Reply #3 on: February 25, 2014, 08: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?

createasaurus

  • Full Member
  • ***
  • Posts: 133
    • View Profile
Re: Camera Rig interfering with Get Axis Vector Relative To Main Camera?
« Reply #4 on: February 25, 2014, 10:17:37 AM »
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!