wovencode / OpenMMO-Other

Ideas, Tasks and others
2 stars 0 forks source link

[task] Create a Targeting component prototype #51

Open francy51 opened 4 years ago

francy51 commented 4 years ago

Should target using raycasts from the attached gameObject's transform.forward (with a height offset)

Targets are attained as GameObjects and filtered by LayerMask

A second component named TargetIndicator attached to the camera will link to the Targeting component. It also raycasts in the camera's (attached gameObject also) forward direction.

From these two components, a target location can be triangulated which an on-screen targeting reticle (just a dot) can follow on the client for visual feedback.

Where the Targeting raycast crosses the TargetIndicator's raycast is where the target will be in worldspace - this is not about selecting characters to show their health bars, that is something different and should live in the PlayerComponent which can manage its own stored targets