playMaker

Author Topic: Simple Camera Relative Force [SOLVED]  (Read 1551 times)

AdamJ

  • Playmaker Newbie
  • *
  • Posts: 11
    • View Profile
Simple Camera Relative Force [SOLVED]
« on: October 09, 2014, 06:24:12 AM »
Hey guys, massive noob question coming up.

I'm having some issues with applying camera relative force to an object when its clicked on. Ive had a look around and cant find anything that talks specifically about the issue im having, as far as im aware i have everything set up as it is needed but it doesnt seem to be working. See the picture below, any help appreciated!

Thanks

« Last Edit: October 16, 2014, 07:24:41 AM by AdamJ »

AdamJ

  • Playmaker Newbie
  • *
  • Posts: 11
    • View Profile
Re: Simple Camera Relative Force
« Reply #1 on: October 16, 2014, 02:52:21 AM »
Bump!

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2488
  • Yup.
    • View Profile
    • Cleverous
Re: Simple Camera Relative Force
« Reply #2 on: October 16, 2014, 04:21:20 AM »
What part isn't working?

AdamJ

  • Playmaker Newbie
  • *
  • Posts: 11
    • View Profile
Re: Simple Camera Relative Force
« Reply #3 on: October 16, 2014, 04:28:34 AM »
I can't get the force to apply relative to the forward direction of the camera.

I have tried setting the vector variable manually to 0,0,1. I have also tried changing  'world' to 'self'.

I'm sure there is something simple that i'm missing but i'm just not sure what it is.

Cheers

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2488
  • Yup.
    • View Profile
    • Cleverous
Re: Simple Camera Relative Force
« Reply #4 on: October 16, 2014, 04:42:44 AM »
The above setup is correct for keyboard inputs, but it looks like you're using touch? If that's the case then you need to translate the touch inputs into a direction vector for the Add Force rather than using Horizontal and Vertical from Get Axis. Those are just values between 0 - 1 to reflect that an input is pressed or not.

AdamJ

  • Playmaker Newbie
  • *
  • Posts: 11
    • View Profile
Re: Simple Camera Relative Force
« Reply #5 on: October 16, 2014, 04:58:16 AM »
Well for now I am just using keyboard/mouse input and trying to apply force to an object relative to the cameras Z axis, however force is being applied to the objects Z axis on both 'world' and 'self'.

The 'TouchVec' is just what I decided to name the variable (sorry if that's confusing).

That said later I do intend to change this to 'when touched' instead of 'when clicked'. But one step at a time heh :)

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2488
  • Yup.
    • View Profile
    • Cleverous
Re: Simple Camera Relative Force
« Reply #6 on: October 16, 2014, 05:39:42 AM »
Ah, alright.

Well, thats the setup for it. I just created a scene and did it. If its not working you can post a repro scene and I can test yours out to see what might be wrong.

AdamJ

  • Playmaker Newbie
  • *
  • Posts: 11
    • View Profile
Re: Simple Camera Relative Force
« Reply #7 on: October 16, 2014, 05:58:36 AM »
I've found another way around it now. (See screeny below.)

Thanks for your help though, your advice steered me in the right direction.