|
I want to know how to turn my head, and the camera, with the movement of a mouse. I also want objects to still be clickable (if it needs modification) and I want to get out of this object movement mode once certain surfaceGUIs in the model are pressed. I can do most of this myself but I'm more concerned about how to move the model itself.
I'd also like if it could be stopped after hitting a certain point (so when the mouse moves so far X it stops). Is any of this possible? If so write code or redirect me to some wiki links. Thanks! |
|
GoulstemJoin Date: 2012-07-04 Post Count: 7177 |
head.CFrame = CFrame.new(head.CFrame.p,mouse.Hit.p) |
|
|
http://pastebin.com/cDMe04x2 |
|
|
Why does the whole player move? |
|
|
Head = Character:WaitForChild("Torso"):WaitForChild("Neck") |
|
|
@Sonic
Because editing the PrimaryPart of a model will rotate the whole model, instead changed the char.Torso.Neck's C1. |
|
|
I tried this;
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:wait()
local Head = Character:WaitForChild("Torso"):WaitForChild("Neck")
local Mouse = Player:GetMouse()
while wait() do
Head.CurrentAngle = Mouse.Hit
end
In a LocalScript of course, but it did not work. What am I messing up? nothing in output. |
|
|
I've been trying to do this myself, but it's not working. Here is what I have.
local plr = game:GetService("Players").LocalPlayer
local m = plr:GetMouse()
local chr = plr.CharacterAdded:wait() or plr.Character
local neck = chr.Torso:FindFirstChild("Neck")
m.Move:connect(function()
neck.C1 = CFrame.new(chr.Head.Position, m.Hit.p)
end)
|
|
|
This kinda works...
local plr = game:GetService("Players").LocalPlayer
local m = plr:GetMouse()
local chr = plr.CharacterAdded:wait() or plr.Character
local neck = chr.Torso:FindFirstChild("Neck")
m.Move:connect(function()
neck.C1 = CFrame.new(Vector3.new(0,-.5,0),m.Hit.p)
end)
|
|
|
I want my player to-
-lock movement on the up and down (Y) axis
-Stop movement on the x axis after a certain point
-When moving left and right with mouse, I want it to move the camera left and right with it. It will be looking up and down, and currently that is not possible with vanilla camera.
Do I need to invert the mouse movements somehow? |
|
|
I like Abstracts for the simple reason that I can flip axis and platformstand and everything looks fine. But, it does not change the camera perspective to look up and down. Any help? |
|