generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: I want to Make my arm follow my mouse how?

Previous Thread :: Next Thread 
xlaser23 is not online. xlaser23
Joined: 10 Dec 2011
Total Posts: 20341
12 Sep 2015 12:59 PM
im always seeing Mouse.Hit.p



http://www.roblox.com/xla-item?id=290739801http://www.roblox.com/aser-item?id=290739819http://www.roblox.com/23-item?id=290739831 R$173 Tx2,006
Report Abuse
SoapyDishy is not online. SoapyDishy
Joined: 31 Aug 2015
Total Posts: 2169
12 Sep 2015 01:02 PM
game.Players.LocalPlayer.PlayerAdded:connect(function(player)
mouse = player:GetMouse()
if player.Left_Arm ~= nil then
repeat wait() do --we need it to keep updating position
wait(0.1)
player.Left_Arm.CFrame = CFrame.Angles(mouse.Hit.p)
end
end
end)

Idk if this can work, but put in a local script
Report Abuse
LongKillKreations is not online. LongKillKreations
Joined: 14 Feb 2014
Total Posts: 4502
12 Sep 2015 01:08 PM
You need to edit the Left and Right Shoudler Motor6Ds (in the torso) to achieve this.

Something like this, you'll need to mess around with the numbers:
http://pastebin.com/vU4w2r7Q

Okay, sure, it doesn't work very well, but you get the idea of you you can accomplish this.
Report Abuse
xlaser23 is not online. xlaser23
Joined: 10 Dec 2011
Total Posts: 20341
12 Sep 2015 01:12 PM
hmm Lets see



http://www.roblox.com/xla-item?id=290739801http://www.roblox.com/aser-item?id=290739819http://www.roblox.com/23-item?id=290739831 R$173 Tx2,006
Report Abuse
xlaser23 is not online. xlaser23
Joined: 10 Dec 2011
Total Posts: 20341
12 Sep 2015 01:15 PM
@soapy an Error happens with end and until ._.



http://www.roblox.com/xla-item?id=290739801http://www.roblox.com/aser-item?id=290739819http://www.roblox.com/23-item?id=290739831 R$173 Tx2,006
Report Abuse
LongKillKreations is not online. LongKillKreations
Joined: 14 Feb 2014
Total Posts: 4502
12 Sep 2015 01:17 PM
I would give you my viewmodel/character rig system but y'know...
Report Abuse
xlaser23 is not online. xlaser23
Joined: 10 Dec 2011
Total Posts: 20341
12 Sep 2015 01:17 PM
._.



http://www.roblox.com/xla-item?id=290739801http://www.roblox.com/aser-item?id=290739819http://www.roblox.com/23-item?id=290739831 R$173 Tx2,006
Report Abuse
SoapyDishy is not online. SoapyDishy
Joined: 31 Aug 2015
Total Posts: 2169
12 Sep 2015 01:17 PM
Instead of the repeat wait() put

for i =1,math.huge do
Report Abuse
LongKillKreations is not online. LongKillKreations
Joined: 14 Feb 2014
Total Posts: 4502
12 Sep 2015 01:19 PM
"Instead of the repeat wait() put

for i =1,math.huge do"

Update on RenderStepped and use linear interpolation if you want ti to actually be smooth.
Report Abuse
SoapyDishy is not online. SoapyDishy
Joined: 31 Aug 2015
Total Posts: 2169
12 Sep 2015 01:20 PM
What does render stepped do
Report Abuse
LongKillKreations is not online. LongKillKreations
Joined: 14 Feb 2014
Total Posts: 4502
12 Sep 2015 01:20 PM
Updates every time a frame is rendered

In most cases that's every 1/60 of a second
More effecient then a loop
Report Abuse
rayk999 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
12 Sep 2015 01:22 PM
while true do
coroutine.yield()
--code
end

hueheuheueheuheuheeeeeee


"You're all idiots"
Report Abuse
xlaser23 is not online. xlaser23
Joined: 10 Dec 2011
Total Posts: 20341
12 Sep 2015 01:25 PM
i tried editing

game.Players.LocalPlayer.PlayerAdded:connect(function(player)
local mouse = player:GetMouse()
if player.Character["Left Arm"] ~= nil then
for i =1,math.huge do
wait(0.1)
player.Character["Left Arm"].CFrame = CFrame.Angles(mouse.Hit.p)
end
end
end)


Still Getting an Error occurred



http://www.roblox.com/xla-item?id=290739801http://www.roblox.com/aser-item?id=290739819http://www.roblox.com/23-item?id=290739831 R$173 Tx2,006
Report Abuse
LongKillKreations is not online. LongKillKreations
Joined: 14 Feb 2014
Total Posts: 4502
12 Sep 2015 01:25 PM
First, that code won't work and will probably kill you.

Second, did you completely disregsrd all my posts
Report Abuse
xlaser23 is not online. xlaser23
Joined: 10 Dec 2011
Total Posts: 20341
12 Sep 2015 01:26 PM
No i didnt i was looking at le pastebin



http://www.roblox.com/xla-item?id=290739801http://www.roblox.com/aser-item?id=290739819http://www.roblox.com/23-item?id=290739831 R$173 Tx2,006
Report Abuse
xlaser23 is not online. xlaser23
Joined: 10 Dec 2011
Total Posts: 20341
12 Sep 2015 01:37 PM
Long i put the script inside an Local script

inside starterplayer e.e nothuing happenign



http://www.roblox.com/xla-item?id=290739801http://www.roblox.com/aser-item?id=290739819http://www.roblox.com/23-item?id=290739831 R$173 Tx2,006
Report Abuse
SoapyDishy is not online. SoapyDishy
Joined: 31 Aug 2015
Total Posts: 2169
12 Sep 2015 01:55 PM
Forgot PlayerAdded is only for regular scripts
Report Abuse
JonathanW123 is not online. JonathanW123
Joined: 04 Apr 2012
Total Posts: 5832
12 Sep 2015 01:57 PM
Good question


Falcons for Life
Report Abuse
SoapyDishy is not online. SoapyDishy
Joined: 31 Aug 2015
Total Posts: 2169
12 Sep 2015 01:58 PM
I think it's regular scripts only. Also can anyone give an example using renderstepped
Report Abuse
SoapyDishy is not online. SoapyDishy
Joined: 31 Aug 2015
Total Posts: 2169
12 Sep 2015 01:59 PM
game.Players.PlayerAdded:connect(function(player)
local mouse = player:GetMouse()
if player.Character["Left Arm"] ~= nil then
for i =1,math.huge do
wait(0.1)
player.Character["Left Arm"].CFrame = CFrame.Angles(mouse.Hit.p)
end
end
end)

Put in regular script

Report Abuse
Nirvanic is not online. Nirvanic
Joined: 07 Sep 2015
Total Posts: 8
12 Sep 2015 05:08 PM
r = game:GetService'RenderStepped'

r.RenderStepped:connect(function()
-- CODE
end)

That is renderstepped. It fires every 1/60 of a second.



Trader/Scripter/Builder/Clothing Designer
Report Abuse
Nirvanic is not online. Nirvanic
Joined: 07 Sep 2015
Total Posts: 8
12 Sep 2015 05:10 PM
Woopsie, here is it fixed.


r = game:GetService'RunService'

r.RenderStepped:connect(function()
-- CODE
end)



Trader/Scripter/Builder/Clothing Designer
Report Abuse
CaptainGector is not online. CaptainGector
Joined: 02 May 2014
Total Posts: 487
12 Sep 2015 05:22 PM
LOL
Put this in workspace

game.Players.PlayerAdded:connect(function(player)
wait(2)
local mouse = player:GetMouse()
local X = mouse.Hit.p.X
local Y = mouse.Hit.p.Y
local Z = mouse.Hit.p.Z
if player.Character["Left Arm"] ~= nil then
for i =1,math.huge do
wait(0.1)
print(X..Y..Z)
player.Character["Left Arm"].CFrame = CFrame.Angles(X,Y,Z)
end
end
end)

Report Abuse
xlaser23 is not online. xlaser23
Joined: 10 Dec 2011
Total Posts: 20341
12 Sep 2015 05:28 PM
.-.



http://www.roblox.com/xla-item?id=290739801http://www.roblox.com/aser-item?id=290739819http://www.roblox.com/23-item?id=290739831 R$173 Tx2,006
Report Abuse
CaptainGector is not online. CaptainGector
Joined: 02 May 2014
Total Posts: 487
12 Sep 2015 05:35 PM
Here's an idea
game.Players.PlayerAdded:connect(function(player)
wait(2)
local fake = Instance.new("Part")
fake.Anchored = true
fake.Parent = player.Character["Left Arm"]
fake.CFrame = fake.Parent.CFrame
fake.Name = "fakeArm"
fake.CanCollide = false


local mouse = player:GetMouse()
if player.Character["Left Arm"] ~= nil then
for i =1,math.huge do
wait()
local X = mouse.Hit.p.X
local Y = mouse.Hit.p.Y
local Z = mouse.Hit.p.Z
player.Character["Left Arm"].fakeArm.CFrame = CFrame.new(player.Character["Left Arm"].Position)*CFrame.Angles(X,Y,Z)
end
end
end)

Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image