- Home /
Question by
MrWy07 · Jul 12, 2021 at 02:09 PM ·
positionlinerendererworldspace
Line renderer length
The question is simple: I am using a line renderer which can be moved around the player with a virtual joystick and can't go through objects (an ability indicator) but how can I set a max length to it? I know usually a scale will solve it but it's a child element set to world space so it doesn't work..
if(Physics.Raycast(transform.position, transform.forward, out hit)) {
LR.SetPosition(1, hit.point);
}
Comment
Best Answer
Answer by SirCrazyNugget · Jul 12, 2021 at 02:58 PM
Use of the 4th parameter defines max distance
physicsoriginsignatures.png
(22.2 kB)