Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make Arrow face same direction as player? [Solved By Comments]

Asked by 6 years ago
Edited 6 years ago

This is a question about Guis.... I'm really having a hard time on this.... and i cant seem to find a way to do it. So let me explain... I have a minimap, Minimap haves an arrow. I need to make the arrow face the player Front Direction This code works... Which makes the Arrow spin. (This script is inside the Arrow Frame)

while true do
script.Parent.Rotation = script.Parent.Rotation - 1
end

But This one "Which i need" Doesn't

p = game.Players.LocalPlayer
while true do
script.Parent.Rotation = p.Character.Torso.Orientation
end

Is there a specific value that Parts return that shows their Rotation? I need the arrow to face The Front of torso So whenever the player looks somewhere The arrow on the minimap also changes. Remembering That We're talking here about converting 3D Part Rotations into 2D Image Rotation (Minimap basics)

(i don't know how to send images there)

A good idea of the minimap is Gta:San Andreas Minimap.

0
use lookvector and CFrames. User#21908 42 — 6y
0
Lookvector, I know it's a property of CFrames But.. I don't Understand it's usage, Could you please explain to me? DevSersponge 5 — 6y
0
Also tried this: script.Parent.Rotation = p.Character.Torso.CFrame.lookVector DevSersponge 5 — 6y
0
Also i'd need to conver the Cframe values into a Unique value Since LookVector Returns 2 Values.. I'd Need it to be One DevSersponge 5 — 6y
View all comments (3 more)
0
the LookVector of an object's CFrame is the forward facing direction of the object theking48989987 2147 — 6y
0
also note that the orientation of an object isn't the same as the object's look vector theking48989987 2147 — 6y
0
Oh!!! thank you everyone those comments really did help i ended up using the following math.deg(math.atan2(torso.CFrame.lookVector.X, torso.CFrame.lookVector.Z)) DevSersponge 5 — 6y

Answer this question