Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

How to draw a texture in worldspace and move said texture's position?

Discussion in 'Scripting' started by RayDawg, Mar 18, 2015.

  1. RayDawg

    RayDawg

    Joined:
    Mar 19, 2013
    Posts:
    108
    I figured out how to create a ground targeting effect similar to Dragon Age: Origins and Guild Wars 2, but I just need a texture to appear on the ground. Does anyone know how to get a texture to be drawn in world space and update its position while in the world?
     
  2. Strategos

    Strategos

    Joined:
    Aug 24, 2012
    Posts:
    255
  3. KelsoMRK

    KelsoMRK

    Joined:
    Jul 18, 2010
    Posts:
    5,539
    Or use a projector. Or a world space UI image.
     
  4. RayDawg

    RayDawg

    Joined:
    Mar 19, 2013
    Posts:
    108
    Can you specify sizes of textures/images using a projector? Because from what I understand, based on the manual, is that the size is based on the camera frustum and not the mouse's raycast hit point?
     
  5. KelsoMRK

    KelsoMRK

    Joined:
    Jul 18, 2010
    Posts:
    5,539
    It depends on the settings in the projector. In terms of mouse position - you can raycast the ground and position the projector over top of that point and face it straight down.