Forum rules - please read before posting.

"Walk" cursor only over floor

edited September 2014 in Technical Q&A
Hi there,

In point and click, context-sensitive mode, is there an easy way to make the cursor change to the "Walk" cursor (and the player to actually walk to that point upon clicking) only when the cursor is hovering over the floor (as opposed to when it is hovering over anything which isn't a hotspot)? I seem to recall some discussion about this but I can't find it.

Thanks!

Comments

  • For the cursor-change, you may be able to do this by adding the Hotspot script to the NavMesh (assuming it's a Mesh Collider - otherwise create a dedicated Hotspot of the same size).

    By default, AC "scans" nearby pixels if you don't click directly on a NavMesh, but you can disable this by reducing the NavMesh search % to 0 within the Settings Manager.
  • The NavMesh search % worked like a charm, thanks. You learn something new every day. :)

    Now regarding the "Walk" cursor, I'm not even sure it's possible at the moment. I'm using Unity Navigation and I can't make a hotspot with the exact same shape as that of the combined NavMeshSegments. And even if I could, how would it work with a hotspot? Did you mean using the Use interaction for the walking? Something else?
  • I meant simply leaving the Interaction field blank, so the Hotspot changes the cursor, but clicking it doesn't actually do anything.  But alas, I tried it myself and it wouldn't work.

    I'll look into adding a dedicated Cursor for such a case.
  • Thanks. (I did try the hotspot myself as well and reached the same conclusion :) )

    And speaking of cursors, a long time ago we spoke of hardware cursors and I wanted to touch base and see if this has been implemented or not. I mean using hardware cursors as opposed to software cursors, which depend on FPS.

  • Sorry, you'll have to forgive my ignorance on this one.  What exactly is the difference, and why is one better than the other?
  • Hardware cursors are cursors managed by the operating system and as such, they are frame rate independent. This means that if the game is running slowly, the cursor movement will still feel sharp and quick. Software cursors are cursors managed and rendered by Unity together with all other renderings, and as such, slow frame rate will definitely be felt by the user when moving the cursor. There are both advantages and disadvantages to each cursor type so it's up to the developer to decide which is best for his game.

    When using Unity's Cursor.SetCursor() method, the developer has the option to specify whether he wants software or hardware cursors.

    Here is a good reference on the subject.

    It would be great if AC could give the developer the option to decide what type of cursors he wishes to have, software or hardware.

  • Thank you, that helps a lot.
  • Hi,

    I tested the Walk cursor and the new "Only show 'Walk' Cursor when over NavMesh?" option and I'm not sure what to make of what I'm getting. The Walk cursor is indeed displayed but not exactly where I would expect it to. Please take a look at the following screenshots to see what I mean. The arrow cursor is the Main cursor and the arrow with the feet is the Walk cursor. The green surface is the NavMesh, of course. I’m using Unity Navigation and have three NavMeshSegments (one of them on the slope).

    imageimageimageimage
  • Could it be that it's reading the inverted y-position of the cursor?

    Try amending PlayerCursor.cs line 323.  Replace GetInvertedMouse with GetMousePosition - does that correct the issue?
  • Yes it does. Nice catch! :)
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.