Can I make player rotate to cursor position with ORK node editor (like in top-down shooters for example, while holding down a mouse button)?
Or should I use custom scripts (or maybe Makinom)?
  • You can do this in the event system by using a Raycast To Variable node to get the position the mouse is currently at (i.e. what's currently below the mouse) and a Roate To node to rotate the player's game objec to the stored position (Vector3 variable).
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thanks again, it's working.
  • Another question, can I somehow change the cursor view, while this event is active?
    For example change cursor image from standard to "target" image?
  • edited September 24
    Sadly ork doesn't have a node to do this. Using his other asset, Makinom, it's easily done. Following the tutorial on how to connect ork and makinom together, just create a schematic using the change cursor texture node, save it, and in the ork's event, use the call makinom schematic node to call the node.
    Or just create a script to change the cursor(easy to do as well), and call the function using the call function node
    Post edited by Shadow_Fire on
  • Thank you, I'll try that.
  • You can also do the complete mechanic in Makinom :)
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited September 25
    Shadow_Fire said: Or just create a script to change the cursor(easy to do as well), and call the function using the call function node
    Ok, I created this script
    public class cursortarget : MonoBehaviour {
    public Texture2D cursorTexture;
    public CursorMode cursorMode = CursorMode.Auto;
    public Vector2 hotSpot = Vector2.zero;


    public void targetcursorset () {

    Cursor.SetCursor(cursorTexture, hotSpot, cursorMode);

    }


    public void targetcursorremove () {
    Cursor.SetCursor(null, Vector2.zero, cursorMode);
    }
    }
    Attached it to the player and attached a texture to it.
    Added two "Call Function" nodes to an event for changing cursor to "target" texture and back.
    And it works fine... on an empty field without enemies.
    But when the enemy comes in a certain range near the player, cursor starts to blink and constantly change from target to normal and back (while I'm holding an event button).

    I can't figure out why this is happening.
    I was thinking, maybe it has something to do with raycast, so I disabled raycast step in the event, but it keeps happening. Only when enemies are near the player. Do you have any ideas, where should I look?

    UPD: now I found out, cursor is blinking when player gets targeted by the enemy. I think It's because ORK cursor settings ("menu settings > cursor settings") are messing with my script.
    Maybe I'll try to use Makinom.

    UPD2: Tried the same with Makinom node call, issue still remails. If I only could override ORK cursor settings with this event, but I don't know if it is possible.
    Post edited by Arc_anzu on
  • Are you using ORK's cursor settings?
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • gamingislove said: re you using ORK's cursor settings?
    Yes.
    Can I disable it, so this settings won't interfere with the event?
    I couldn't find how.
  • Hm, no, currently not. I'll look into adding options for this, maybe a new event node to enable/disable ORK's cursor feature as needed.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.