hai!
I am making a first person game and i want the arms to move with the camera, i want to do this by getting tge orientation of the camera but how do u get the orientation of the camera? I also want to have shiftlovk enabled (always) on a computer or a way so u can’t zoom out if that makes sense. Anyways i hope u can help!
2 Likes
For the zoom out problem, if you click on “StarterPlayer” in the explorer window, you can change the default camera type.
LockFirstPerson is what you need. Though people can change that on their own but honestly it shouldn’t really do any damage to your game.
1 Like
Are working on the first person aesthetic, if so you are doing it wrong I recommend you have look here
This is my first tutorial here!
Point out any errors in the code, please. I might have missed something.
0. Quick info
0.1
I have made many past attempts at making pew pew guns on roblox in the past, and i thought i’d share some of the “basic” process for beginners here. Keep in mind none of this needs to be the way it is here, feel free to use your own methods.
0.2
This article covers the very basics on setting up a working gun, making it aim (and how to make it easy to add other thin…
1 Like
game.Workspace.CurrentCamera.CFrame:ToEulerAnglesXYZ()
Have you searched on the forum?
1 Like
for some reason it won’t change the orientation?
part.Orientation = Vector3.new(game.Workspace.CurrentCamera.CFrame:ToEulerAnglesXYZ()
inside a localscript
Sigh, don’t do part.Orientation but part.CFrame
You’re attempting to compare a Vector3
with a CFrame
value I believe
Try this?
local CamCFrame = CFrame.new(workspace.CurrentCamera.CFrame:ToEulerAnglesXYZ())
print(CamCFrame)
Part.CFrame = Cam.CFrame
1 Like
Isn’t CFrame also Position though?
BPilot253
(BPilot253)
April 10, 2021, 1:53pm
#9
CFrame contains both positional and orientational data while Vector3 - only positional.
If you use CFrame.Position/X/Y/Z
, yes
I only want the orientation, the position is already done
BPilot253
(BPilot253)
April 10, 2021, 1:58pm
#12
You can do what JackScarlett said
It glitches out a lot and it won’t rotate with the camera
You might need to use RunService's RenderStepped
event if you want the arms to move in a smooth way I persume?
1 Like
after a few seconds it deletes it? I tried using the head cframe instead, and it works. but it goes away after 3 seconds or so
You might need to use a WeldConstraint
or a animation maybe? You could also refer to the post @CreepingGamingTV gave earlier
1 Like
RFL890
(GeorgeCatherington)
April 10, 2021, 2:42pm
#17
I'm currently making a FPS game right now. Can somebody help me make a non-local script that makes both arms, tools, and the head follow the player's camera. I am decent at scripting but have a hard time comprehending trigonometry. Thank you for...
The quickest google search will get you the answer. The accepted script:
(Remove the ``) at the end
will work for r6.
(Don’t use the my script is better for fps - it will glitch the char)
1 Like