Next: , Previous: , Up: Motion   [Contents][Index]


12.12 Mouse Follow

Component: MouseFollow

This component causes an object to always be at the position of the mouse in the world. To use, add it to an object that you want to follow the mouse. Then, populate the Layer Mask at the top with layers of objects that represent the world geometry, such as the terrain. Then, this object will always be under the player’s cursor while it’s alive, as long as the cursor is over one of these object groups. This can be useful for selection painting, object placement, spellcasting, or creating a light around the cursor in dimly-lit game areas.

Field of MouseFollow: LayerMask layerMask

What kinds of things can the mouse pass onto?

Constraint Settings

Field of MouseFollow: float maxDistance

How far away can the mouse be at most?

Default value: 1500.0f

Field of MouseFollow: bool constrainX

Should my position be constrained on the X axis?

Default value: false

Field of MouseFollow: bool constrainY

Should my position be constrained on the Y axis?

Default value: false

Field of MouseFollow: bool constrainZ

Should my position be constrained on the Z axis?

Default value: false

Field of MouseFollow: LayerMask layerMask

What kinds of things can the mouse pass onto?

Constraint Settings

Field of MouseFollow: float maxDistance

How far away can the mouse be at most?

Default value: 1500.0f

Field of MouseFollow: bool constrainX

Should my position be constrained on the X axis?

Default value: false

Field of MouseFollow: bool constrainY

Should my position be constrained on the Y axis?

Default value: false

Field of MouseFollow: bool constrainZ

Should my position be constrained on the Z axis?

Default value: false


Next: , Previous: , Up: Motion   [Contents][Index]