So I tried this but it didn’t work how I wanted it. I wanted to the bean to be transparent but the arrow texture to be visible
If the image you’re using has a transparent background, it should be transparent.
The image was transparent with think but the beam was white and not only the transparency problem but also the arrow is facing the wrong way
You’ll have to check your image on that. The image will replace the default beam texture, including transparency.
Then how would I go on making a arrow that points towards the next stage
Change the second (or first) attachment to the new checkpoint. But if you’re having trouble with beams, you can just have a 3D arrow point towards the next checkpoint. I would recommend putting it in a ViewportFrame though.
One like an arrow that is attached to the player and rotate if you turn
Kind of, but you’d use a CFrame construct to rotate it towards the next target.
Arrow.CFrame = CFrame.new(Arrow.Position,NextCheckpoint.Position)
Or use an offset of the player’s root part instead of the arrow’s position if you’re not using a ViewportFrame.
I would like the arrow attached to the humanoid root part and then from there change the position of it around it depending where the next stage is
Where on the screen would you want the arrow? Above or below, or somewhere else?
The arrow is a part not gui it rotates around the player to the pointing direction
Oh, that’s clever. I guess you’d do the CFrame thing I showed, but replace the Arrow’s position with the root’s position, then offset it forward. That should give the desired outcome.
How would I offset it towards the stage?
It will automatically do that as CFrame is always relative. So when constructing a CFrame with two positions:
The first position is the position it will be, and the second position is the position it will look towards. Then by applying a math operation:
You can offset its position relative to that CFrame. So moving it forward would move it forward in the direction its facing, which would be towards the next checkpoint. You’d only want to move it maybe 4 studs or however far away from the avatar you want.
Full documentation here:
Thank you so much u have explained it very well!
Is this how I do it
CFrame.lookAt(HumanoidRootPart.Position, Stage.Position)
Just how would I make it so it doesn’t mess up it’s orientation so it’s not facing backwards
If this works I will checkmark this solution
For that, you can also use a math operation to change its angle, but do that before you multiply its position. Or you can just edit the pivot beforehand.
It should look something like this:
https://i.gyazo.com/71c1847bf8678767492470d17eb290c4.mp4
You can look at the code here:
Perfect! Thank you so much!!! Also how would I increase the transparency when I get closer to the stage
local mag = (arrow.Position-target.Position).Magnitude -1
arrow.Transparency = 1-(math.clamp(mag,0,2)/2)
The code can be found in that model. The LocalScript is a child of the “Main” server script inside of the obby folder.
Why is it -1 on the “msg” variable
That’s to make it transparent sooner by subtracting the magnitude (stud distance between two points) by 1. Otherwise the arrow would only reach full transparency if it were literally inside of the target part. I wanted it to become transparent before it has a chance to collide with the target part for a cleaner appearance.