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: Pointing an arm at a position,

Previous Thread :: Next Thread 
LuaLlama is not online. LuaLlama
Joined: 25 Jan 2014
Total Posts: 1123
18 Feb 2015 05:09 PM
I wanted to make an arm on a Non-Humanoid object point at you, i only needed the arm pointing part.

If if do this:

Point = CFrame.new(Arm.Position, Player.Head.Position)
Arm.CFrame = Point

it Points, but it looks like the arm is not attached.
Report Abuse
LeitrisArcade is online. LeitrisArcade
Joined: 15 May 2010
Total Posts: 2127
18 Feb 2015 05:10 PM
Make a weld/motor and rotate it based on the joint's C1.

( ͡ಠ ͜ʖಠ)
Report Abuse
LuaLlama is not online. LuaLlama
Joined: 25 Jan 2014
Total Posts: 1123
18 Feb 2015 05:12 PM
I wanted to use cframe. :/
Report Abuse
LeitrisArcade is online. LeitrisArcade
Joined: 15 May 2010
Total Posts: 2127
18 Feb 2015 05:12 PM
joint.C1.CFrame = CFrame.new()

( ͡ಠ ͜ʖಠ)
Report Abuse
LeitrisArcade is online. LeitrisArcade
Joined: 15 May 2010
Total Posts: 2127
18 Feb 2015 05:13 PM
Woops, C1 is a CFrame, so it's written like this:

joint.C1 = CFrame.new()

( ͡ಠ ͜ʖಠ)
Report Abuse
LeitrisArcade is online. LeitrisArcade
Joined: 15 May 2010
Total Posts: 2127
18 Feb 2015 05:14 PM
Then you can rotate it like this:

joint.C1 = CFrame.new() * CFrame.Angles()

( ͡ಠ ͜ʖಠ)
Report Abuse
LuaLlama is not online. LuaLlama
Joined: 25 Jan 2014
Total Posts: 1123
18 Feb 2015 05:14 PM
Thanks, but is there a way without using joints and/or welds?
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
18 Feb 2015 05:15 PM
Leitris, explain HOW EXACTLY to use C1 just in case someone might want to know...

"My Life is going Good... but..."
Report Abuse
EliteDerper is not online. EliteDerper
Joined: 05 Feb 2012
Total Posts: 2288
18 Feb 2015 05:18 PM
@Kap
You?
Report Abuse
LeitrisArcade is online. LeitrisArcade
Joined: 15 May 2010
Total Posts: 2127
18 Feb 2015 05:20 PM
Local w = Instance.new("Weld",PARENT)
w.Part0 = PARENT PART
w.Part1 = PART CONNECTED TO PARENT PART
w.C0 = JOINT POSITION
w.C1 = PART'S OFFSET FROM JOINT

( ͡ಠ ͜ʖಠ)
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
18 Feb 2015 05:20 PM
http://wiki.roblox.com/index.php?title=Joint#Programmatic_Creation
Report Abuse
LeitrisArcade is online. LeitrisArcade
Joined: 15 May 2010
Total Posts: 2127
18 Feb 2015 05:20 PM
Sorry if that looked harsh, I just wrote in caps to show where to put things. Kind of looked like I was yelling lol.

( ͡ಠ ͜ʖಠ)
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
18 Feb 2015 05:22 PM
Use the wiki. -_-
http://wiki.roblox.com/index.php?title=Joint#Programmatic_Creation
Report Abuse
LeitrisArcade is online. LeitrisArcade
Joined: 15 May 2010
Total Posts: 2127
18 Feb 2015 05:22 PM
Yeah ^

( ͡ಠ ͜ʖಠ)
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
18 Feb 2015 05:23 PM
Oh. It tried to do a duplicate post. I hate that error. Although I have never actually posted a second time as a result of it, until now.
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
18 Feb 2015 05:23 PM
lol I meant how to do the thing... cos CFrame.new(part.Position, target.Position) wont Work with Joints :P

Elite, I would but, I haven't yet Experimented with Arms... and also, I'm still in the Middle or even Beginning of figuring out how exactly the chunk of Code I have Works XD

"My Life is going Good... but..."
Report Abuse
Aj7Fish is not online. Aj7Fish
Joined: 30 Dec 2014
Total Posts: 500
18 Feb 2015 05:23 PM
I added a script inside an npcs head, and I want to npcs head to stare at me and move it's head around facing me. I have this but it didn't work. Why Leitris?


game.Players.PlayerAdded:connect(function(player)
local weld = Instance.new("Weld")
weld.Part1 = script.Parent -- npc Head
weld.Part0 = player:WaitForChild("Character").Head -- player's head
weld.C1 = CFrame.new() * CFrame.Angles(player.Character.Head.Rotation)
end)

Report Abuse
LuaLlama is not online. LuaLlama
Joined: 25 Jan 2014
Total Posts: 1123
18 Feb 2015 05:25 PM
Couldn't I just use CFrame alone?
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
18 Feb 2015 05:29 PM
CFrames alone wouldn't be Enough and in anyway, I'd Recommend Joints...
u could Learn to Script ur Character Head and Arms follow Mouse for FPS Games...

"My Life is going Good... but..."
Report Abuse
LuaLlama is not online. LuaLlama
Joined: 25 Jan 2014
Total Posts: 1123
18 Feb 2015 05:30 PM
I'm not using a humanoid :/ I'm using an anchored part :P
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
18 Feb 2015 05:32 PM
well anyway... all u need is

part.CFrame = CFrame.new(part.Position, target.Position)

"My Life is going Good... but..."
Report Abuse
LuaLlama is not online. LuaLlama
Joined: 25 Jan 2014
Total Posts: 1123
18 Feb 2015 05:40 PM
Nvm i'll use joints :/
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
18 Feb 2015 05:44 PM
lol

"My Life is going Good... but..."
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