Announcement

Collapse
No announcement yet.

Setting actor location according mouse position

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Setting actor location according mouse position

    As in a building system where player is placing a new building part, wall, foundation, etc. Could someone share an example on how to achieve this?
    I tried something with DeprojectScreenPositionToWorld but doesn't seems to be what I'm looking for.
    Thanks in advance.

    #2
    You want to cast a trace from camera forward until floor is hit... Then set actor location to hit point.

    If buildings are complex you'll need a grid / voxel system.
    | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

    Comment


      #3
      Originally posted by BrUnO XaVIeR View Post
      You want to cast a trace from camera forward until floor is hit... Then set actor location to hit point.

      If buildings are complex you'll need a grid / voxel system.
      Thanks more or less got it working with some flaws like the object flickering a lot while being placed. I'm updating it's location on every tick, need to check that.

      Any advice on how to make parts snap to already placed objects?

      Comment

      Working...
      X