3d box 'pitch' question? (SOLVED)

This forum is currently in read-only mode.
From the Asset Store
Over 2700 files with all the colour combinations from a 15 colours palette!
  • Can anybody help me with the following-

    My game has the following objects

    A 3d Box object (gun) with 2 buttons(up and down) that change the boxes pitch.

    A cross-hair sight that only moves in the Y direction (depending on the 3d boxes pitch)

    The 3d boxes pitch range needs start at 24 degrees and end at -24 degrees.

    When the 3d boxes pitch is at 24 the cross-hair's Y position should be 240.

    When the 3d boxes pitch is at -24 the cross-hair's Y position should be 440.

    <img src="http://dl.dropbox.com/u/22173473/question.png">

    Thanks in advance.

  • 440 or 480?

    crosshair.y=lerp(440,240,(3dbox.pitch+24)/48)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 440 or 480?

    crosshair.y=lerp(440,240,(3dbox.pitch+24)/48)

    (The Y is 440)

    Thanks for responding, my next question is how do i implement this?

    For example i have the following event(s)

    + down: Button clicked

    -> barrel: Set pitch to barrel.Pitch-1 degrees.

    What condition/ event combination would i use to set the 'crosshair's Y position?

  • Thanks Lucid, i downloaded your 'quicklerptut' example and worked it out from that.

    Brilliant!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)