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 » Scripting Helpers
Home Search
 

Re: How do I script an Follow-Camera Aim script?

Previous Thread :: Next Thread 
ROBLOXBloxxerDJL is not online. ROBLOXBloxxerDJL
Joined: 08 Aug 2010
Total Posts: 5239
08 Nov 2013 08:18 PM
A Follow-Camera Aim (FCA) script is where when you aim a gun, the camera follows it. Like if you pan the camera up, the gun points up. If you pan the camera down, the gun points down. Your head, torso, and arms follow with the gun as well. You can also do it in First and Third person views.

It's like the one in d4rk886's Base Wars where the gun points to the direction the camera is facing.
Report Abuse
ROBLOXBloxxerDJL is not online. ROBLOXBloxxerDJL
Joined: 08 Aug 2010
Total Posts: 5239
08 Nov 2013 08:27 PM
Bump
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
08 Nov 2013 08:28 PM
A little bit of math with your joints and the camera's cframe
Report Abuse
MHebes is not online. MHebes
Joined: 04 Jan 2013
Total Posts: 2278
08 Nov 2013 08:36 PM
For up/down movement, use asin(lookVectorOfCamera.Y) to get the x angle.
For right/left movement, use atan2(lookVectorOfCamera.z,lookVectorOfCamera.x) to get the z angle.
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
08 Nov 2013 08:58 PM
@MHebes

Free Formula! So like this?

repeat wait() until game.Players.LocalPlayer
player = game.Players.LocalPlayer
character = player.Character
cam = Workspace.CurrentCamera
mouse = player:GetMouse()
torso = character.Torso
rs = torso["Right Shoulder"]
move = false
character:WaitForChild("Animate").Disabled = true
mouse.Move:connect(function()
if move == false then
move = true
rs.C0 = CFrame.new(rs.C0.p)*CFrame.Angles(math.asin(cam.CoordinateFrame.lookVector.Y),math.rad(90),math.atan2(cam.CoordinateFrame.lookVector.Z,cam.CoordinateFrame.lookVector.X))
move = false
end
end)
Report Abuse
MHebes is not online. MHebes
Joined: 04 Jan 2013
Total Posts: 2278
08 Nov 2013 09:06 PM
Kinda, I was thinking more a BodyGyro in the torso that controls left/right movement and then just change the x in the Right Shoulder/Neck.
Report Abuse
ROBLOXBloxxerDJL is not online. ROBLOXBloxxerDJL
Joined: 08 Aug 2010
Total Posts: 5239
09 Nov 2013 09:46 AM
Tried, didn't turn out the way it should.

I was meaning that when you have any type of gun equipped and pointed out, wherever you move the mouse/camera, the aim follows, so does the head, torso, and arms. Also where the animate script isn't affected.

I want it to be identical to what d4rk886 has in Base Wars.
Report Abuse
breuning is not online. breuning
Joined: 30 Oct 2008
Total Posts: 4268
09 Nov 2013 09:50 AM
well bad for you that i am not in a good mood and i dont like requesters.

http://wiki.roblox.com/index.php/CFrame
http://wiki.roblox.com/index.php/Welds
http://wiki.roblox.com/index.php/Function_Dump/Mathematical_Functions
Report Abuse
ROBLOXBloxxerDJL is not online. ROBLOXBloxxerDJL
Joined: 08 Aug 2010
Total Posts: 5239
09 Nov 2013 10:05 AM
@breuning

tl;dr
Report Abuse
breuning is not online. breuning
Joined: 30 Oct 2008
Total Posts: 4268
09 Nov 2013 10:23 AM
bad for you
Report Abuse
ROBLOXBloxxerDJL is not online. ROBLOXBloxxerDJL
Joined: 08 Aug 2010
Total Posts: 5239
09 Nov 2013 12:14 PM
Somebody else?
Report Abuse
1x1REBORN is not online. 1x1REBORN
Joined: 23 Feb 2013
Total Posts: 80
09 Nov 2013 12:28 PM
dude, no one's going to help you if you don't know how to script at all and also if you're ignorant of their advice
Report Abuse
FoggedOut is not online. FoggedOut
Joined: 09 Dec 2011
Total Posts: 3021
09 Nov 2013 12:29 PM
What I would do: Make Regular gun, Shift Lock myself

Obviously that's not what you want, but its fun c;

ℱoggedOut ~
Report Abuse
ROBLOXBloxxerDJL is not online. ROBLOXBloxxerDJL
Joined: 08 Aug 2010
Total Posts: 5239
09 Nov 2013 12:39 PM
Hebes and Evolved helped, but not what I want.


Somebody else?
Report Abuse
jonesj627 is not online. jonesj627
Joined: 06 Oct 2010
Total Posts: 1496
09 Nov 2013 12:40 PM
I've had the same question for awhile, someone help him please.
Report Abuse
PurelyRandom is not online. PurelyRandom
Joined: 05 Mar 2011
Total Posts: 36763
09 Nov 2013 12:46 PM
@Roblox; Make your own with the information provided to you. Nobody is going to give you a full working script without you paying them over 10,000 robux.
Report Abuse
FoggedOut is not online. FoggedOut
Joined: 09 Dec 2011
Total Posts: 3021
09 Nov 2013 12:46 PM
@Pure, Correct, but I don't think its worth 10k xD

ℱoggedOut ~
Report Abuse
ROBLOXBloxxerDJL is not online. ROBLOXBloxxerDJL
Joined: 08 Aug 2010
Total Posts: 5239
09 Nov 2013 10:35 PM
@Pure

It's more like 10 ROBUX.
Report Abuse
MHebes is not online. MHebes
Joined: 04 Jan 2013
Total Posts: 2278
10 Nov 2013 10:24 AM
Assuming a script like this would take 1 hour to create (which it very well would), and seeing as how minimum wage in the US is $7.25/hour and it costs $4.95 to purchase 400 R$, It would actually cost 586 R$ if we're working at minimum wage, which we really shouldn't be. It would probably be a fair bet we'd be working at twice that - so 1000 R$ would be reasonable.

In any case, I definitely DID tell you what you're looking for, you just don't get what I said and I didn't give you a script. I'll try and come up with something - but I'm on the fence about handing it out.
Report Abuse
PurelyRandom is not online. PurelyRandom
Joined: 05 Mar 2011
Total Posts: 36763
10 Nov 2013 11:27 AM
@Roblox; I loled.
Report Abuse
FoggedOut is not online. FoggedOut
Joined: 09 Dec 2011
Total Posts: 3021
10 Nov 2013 12:02 PM
@MHebes, Smart.... .-. Wow, I could make a living off of scripting barely anything. XD

ℱoggedOut ~
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
10 Nov 2013 12:07 PM
I stink at all this advanced math stuff.

I don't understand trigonometry, it's sad.

I also don't understand how it would help.
Report Abuse
FoggedOut is not online. FoggedOut
Joined: 09 Dec 2011
Total Posts: 3021
10 Nov 2013 12:11 PM
@Evolved, I've never gotten into that (8th grade qq), but I'm actually doing 9th grade math so like... swag.

ℱoggedOut ~
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
10 Nov 2013 12:12 PM
I'm in 7th.

And 12 years old.

and I still don't get it a;lkjgna;duofbha;vb
Report Abuse
FoggedOut is not online. FoggedOut
Joined: 09 Dec 2011
Total Posts: 3021
10 Nov 2013 12:13 PM
Oh, ok, so then I'm smart but not fully? Ok, sounds legit man... Lol, jk.

and a;lkjgna;duofbha;vb means this stuff?

ℱoggedOut ~
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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