1. #1

    change angle with left stick?

    anyone know how to simply change an angle by moving the left toggle up or down?
    the examples of making things move I've seen don't really deal with angles and are really complex for what I want to do..
    thanks , incase u haven't noticed I've got a few maps in the go I'm a editor beginner ish , so I have lots of questions , I've realised some so search a nemesis gamer to see my work so far
    Share this post

  2. #2

    Re: change angle with left stick?

    It would depend on what sort of angle you wanted to change for what solution I would suggest. Are you talking about camera angles, angles of ramps, angles of scenery?
    Share this post

  3. #3

    Re: change angle with left stick?

    The angle for a cannon for range , im trying to just do it with directional forces at the monent, and failing lol
    Share this post

  4. #4

    Re: change angle with left stick?

    Edit: didn't see your new comment. If all you're trying to do is change the direction that something is facing, use an Object Position event to rotate the object. Pitch should be look up/down, Yaw is look left/right, and Bank is rotate left/right.

    If you mean camera angle, the easiest solution would be to use multiple game cameras. Set every camera to act as the game camera. Set every camera but the first to be disabled.

    Objects:
    Camera 1
    Camera 2
    Camera 3
    Camera 4
    ...

    Impulse:
    Interval, 0 start/1 interval

    Pseudocode:

    [code:3ugo9xps]If (Sign(Left Stick Vertical) == 1)
    If (Enabled(Camera 1))
    True:
    Disable(Camera 1)
    Enable(Camera 2)
    False:
    If (Enabled(Camera 2))
    True:
    Disable(Camera 2)
    Enable(Camera 3)
    False:
    If (Enabled(Camera 3))
    True: ...
    False: ...
    (Note that the last cast will enable Camera 1)[/code:3ugo9xps]

    You will also need to do this for the reverse case, where Sign(Left Stick Vertical) == -1. That will start at Camera 1, then proceed to Camera N, then Camera N - 1, etc.

    I wish there was a way to reference objects by a custom name - you could then use a loop from 1 to N where each loop tries to grab "Camera i" until it's successful, but for now we'll have to do it manually.

    If you want to have the cameras reposition themselves relative to a moving actor, you will need to implement some fairly complex math. On the bright side, about 95% of the math will be the same for each camera, with that 5% simple being rotating the camera to the correct XZ-angle and Y angle.

    One formula you can use is:

    angle = atan2 (z, x);
    new_x = length * cos (angle);
    new_y = length * sin (angle);

    Where 'length' is the constant distance (radius) between the actor and the character, and 'z' and 'x' are the position of the actor (i.e. 'X = Camera(X) - Actor(X)', 'Z= Camera(Z) - Actor(Z')... I may have the order backwards, so try reversing Camera and Actor in each equation if that doesn't work). You will need to find another way to use the 'y' angle, though you could simply put the camera at the actor's Y position +- length.

    Good luck!
    Share this post

  5. #5

    Re: change angle with left stick?

    Sorted it thanks for the reply
    Share this post