Rotation problem

FlowCanvas Forums Support Rotation problem

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1024
    westray
    Participant

    Why won’t this flowgraph make the cube turn.The mousedelta input shows constant 0,0

    Attachments:
    You must be logged in to view attached files.
    #1027
    Gavalakis
    Keymaster

    Hey,

    If what you are after here is to rotate the cube when you are holding down Fire1 button and moving the mouse scrollwheel up/down (which is what this flowscript does), then you will need to use the Y value of the Vector2 rather than the X. The x delta for the mouse scroll is always 0.

    Remember, that what you have created in the image, requires that you are holding down the Fire1 button (which by default in Unity is left mouse click or the control key). Otherwise the Rotate node will not execute.

    Let me know.
    Thanks!

    Join us on Discord: https://discord.gg/97q2Rjh

    #1028
    westray
    Participant

    When I hold down the left button and move the mouse nothing shows in the mouse delta.I thought that mouse delta showed the movement of the mouse from one frame to the next.Do I have to use the scroll wheel?

    #1029
    Gavalakis
    Keymaster

    Hey,
    Input.mouseScrollDelta is the mouse wheel delta, not the mouse position delta.
    While you could manually calculate the delta from Input.mousePosition, here is a easier way to do what I assume you want:

    ClickAndDrag

    In the event node used here “Input Axis(Custom)”, you can define any custom axis to use which is set in “Project Settings/Input Manager”. By default Unity has a lot of them already created. “Mouse X” and “Mouse Y” are basically the values you are looking for (mouse position delta).

    For your convenience here is the Input Axis inspector:
    InputAxisInspector

    You can add any number of axis you want to get their value. The “Out” flow port is called when either of those axis is not zero.

    Let me know if that works for you.

    Cheers!

    Join us on Discord: https://discord.gg/97q2Rjh

    Attachments:
    You must be logged in to view attached files.
    #1109
    stereomike
    Participant

    Can you just collect all these small examples that you did over and over for all kinds of tasks and upload a .zip to the downloads area? That way we would have a library to look up how stuff can be done. This is really missing.

    #1113
    Gavalakis
    Keymaster

    Hey,
    That’s a good idea.
    I will skim through the forums to find usable examples posted and pack them up in a downloadable .unitypacakge.
    Thanks.

    Join us on Discord: https://discord.gg/97q2Rjh

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.