How can i make a laser be at a certain angle and position and look at the player no matter where the player is?

If you don’t know what i mean i’ll show you a video

All i need to know is what to use in a script for the part

Thanks

4 Likes

So you just want it to constantly be on the player?
Plug it into a RunService Loop and have the position of the end attachment of the laser be at the position of the HumanoidRootPart of the Character.

4 Likes

Nope, i want the laser to look at the player for a bit no matter where the player is for a short amont of time

and what i mean by “laser” is a part not a beam

2 Likes

Just to avoid confusion, this is what i mean

1 Like

To do this, simply position the part to the player.

Part.Position = Player.Character:GetPivot().Position
1 Like

Ok, but what about the angles?

1 Like

Position is different from Orientation. It should stay the same angle, as set in the picture.

1 Like

This is easy, first, you’ll need the position of the player’s character, and the position of where the beam originates, let’s call the position of the player’s character A, and the origin of the beam B.
So to get a Vector3 that is a straight line from the origin to the character, you subtract B from A, and that looks like

bPart = ...
aPart = ...
local AB = (b.Position - A.Position)

for the rest, it’s just simple programming.

2 Likes

IF ITS OKAY you could use beams.
attachment0 as a locked position (parented in part)
attachment1 as the player position (parented in HRP)

1 Like

Nono that’s not what i meant.

The “Laser” which is a part would be a cylinder and the top edge will be facing the players character for a few seconds and if you don’t move and get caught within the laser you die

It’s just like shown in the video in the third post but different since i’m making it so that it can be dodged.

1 Like