[QUESTION] How would I go about making the cursors look like they are projecting on the surface of the layer hit?

How would I go about making the cursors look like they are projecting on the surface of the layer hit?

I have noticed in several RPG’s the cursor is projected on the ground along the ground plane and on other walkable surfaces instead of always appearing as a billboard to the camera.

The purpose is to make the cursor look cool and also leave a walk to mark on the surface until the player arrives at the area.

2 Likes

Hi @jcordeiro,

Sorry for the delay responding, I meant to the other day and then got distracted.

I like the sound of this idea :slight_smile:

I think you’ll find there are several ways of achieving what you want to do, each with varying levels of difficulty.

One of the easiest approaches might be to simply drop a “pin” as it were, leaving it at that point until the character gets to it. You could expand on this with more detail, possibly grabbing the AI route and draw a line to the pin from the character, perhaps changing the simply pin for a “flag”, make it animate and so on.

Another option might be to take a look at Unity’s projector component.

3 Likes

RaycastHit.barycentricCoordinate will allow you to determine the position and normal of the hit. This would allow you to place a cursor object at permitted destinations, as Rob suggests. You’d need to refactor CursorAffordance and PlayerMovement to create and reap these.

4 Likes

Privacy & Terms