Search Unity

3d adding relative force problems

Discussion in 'Physics' started by HoodwinkDude, Jan 6, 2016.

  1. HoodwinkDude

    HoodwinkDude

    Joined:
    Nov 6, 2015
    Posts:
    6
    This is more of a "I don't know something" problem but a problem none the less.

    I am making a ball obstacle traverse... thingy game and I want to be able to rotate the camera around and add a force on the ball relative to the CAMERA'S co-ordinate system so there are no errors due to the rotation caused by the ball rolling. Can someone please help???

    :)
     
  2. Magnumstar

    Magnumstar

    Joined:
    Oct 3, 2015
    Posts:
    304
    Try Camera.main.transform.forward
     
  3. HoodwinkDude

    HoodwinkDude

    Joined:
    Nov 6, 2015
    Posts:
    6
    I'm trying to move the ball, not the camera. I want to rotate the camera and make the ball move, say, forward in relation to the rotation of the camera
     
  4. Magnumstar

    Magnumstar

    Joined:
    Oct 3, 2015
    Posts:
    304
    Yeah this code will give you to current direction the camera is facing in so you can apply that to your ball transform? I think.