Search Unity

2D rotation with visual scripting

Discussion in 'Visual Scripting' started by xbertou, Jun 18, 2021.

  1. xbertou

    xbertou

    Joined:
    May 3, 2021
    Posts:
    8
    Hi,
    I am trying to move an object for example with the arrows (or the joystick in VR) so that the up arrow (forward on the stick) corresponds to the direction in which the camera is looking. In VR, it means the object moves "naturally" as you would expect...
    I am doing it by rotating the input system vector 2 by the Y angle of the camera. It seems natural but I couldn't understand how to it naturally with the scripting system and I kind of manually made the rotation with cosine and sine, which kind of defeat the purpose of visual scripting. Is there a way to do that with just a few blocks, as I suspect there must be?
    Here is the huge block I end up having (includes convertion from degree to radians, etc.): :(