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: 2d game gun? read please.

Previous Thread :: Next Thread 
AngryNeighbor is not online. AngryNeighbor
Joined: 27 Nov 2008
Total Posts: 113
12 Jul 2014 04:24 PM
So, this is what i need:
say you are facing right, and you are holding the gun straight in front of you:
I want the gun to go up and down, depending on if your mouse is above him or below him.
I dont want it to be aiming at the ground where I put cursor.
This probably makes no sense, but if you have ever played "zombotron2"
Then you should know what i mean.
Report Abuse
AngryNeighbor is not online. AngryNeighbor
Joined: 27 Nov 2008
Total Posts: 113
12 Jul 2014 04:27 PM
I would pay 100-200 robux if someone made one for me based off of the game zombotron2.
Report Abuse
CoolioTree is not online. CoolioTree
Joined: 26 Dec 2012
Total Posts: 2509
12 Jul 2014 04:31 PM
This is against the rules
Report Abuse
AngryNeighbor is not online. AngryNeighbor
Joined: 27 Nov 2008
Total Posts: 113
12 Jul 2014 04:31 PM
How so?
Just say it i will fix it if i can.
Report Abuse
CoolioTree is not online. CoolioTree
Joined: 26 Dec 2012
Total Posts: 2509
12 Jul 2014 04:34 PM
http://www.roblox.com/Late-Forums-place?id=164846628

This is the only place that it'll be allowed in. Make sure you press the "Help request" button when posting.
Report Abuse
AngryNeighbor is not online. AngryNeighbor
Joined: 27 Nov 2008
Total Posts: 113
12 Jul 2014 04:35 PM
This is a scripting problem, and I post all of my stuff here, and never ran into any issues...
whatever.
Report Abuse
AngryNeighbor is not online. AngryNeighbor
Joined: 27 Nov 2008
Total Posts: 113
12 Jul 2014 04:36 PM
I will not play that game. I am requestion help here and offering pay for it.
Report Abuse
BobbyisLOLZ is not online. BobbyisLOLZ
Joined: 17 Aug 2010
Total Posts: 8045
12 Jul 2014 04:43 PM
Not really a scripting problem without a script lol
Report Abuse
AngryNeighbor is not online. AngryNeighbor
Joined: 27 Nov 2008
Total Posts: 113
12 Jul 2014 04:57 PM
xD
idk where else to post.
Report Abuse
MHebes is not online. MHebes
Joined: 04 Jan 2013
Total Posts: 2278
12 Jul 2014 04:59 PM
Is this a GUI?
Report Abuse
AngryNeighbor is not online. AngryNeighbor
Joined: 27 Nov 2008
Total Posts: 113
12 Jul 2014 06:42 PM
Hey MHebes, so you know our 2d script thing?
I have restricted the player to only moving left and right, up and down, but now im trying to add guns.
I need a way for the gun to shoot forward, but change up and down based on the height of your cursor.
Report Abuse
LegendaryAccount is not online. LegendaryAccount
Joined: 02 Jun 2010
Total Posts: 13193
12 Jul 2014 06:43 PM
http://www.roblox.com/shoot-zombies-in-2d-place?id=162455822

>.<
Report Abuse
CyborgDonut is not online. CyborgDonut
Joined: 06 Aug 2013
Total Posts: 733
12 Jul 2014 06:50 PM
Guys, he whens where the gun faces the same way but follows the cursor and only does 180 degrees.
Report Abuse
MHebes is not online. MHebes
Joined: 04 Jan 2013
Total Posts: 2278
12 Jul 2014 08:12 PM
If someone can tell me how to project a Vector3 on to the screen and get a Vector2, I could do this I think.
Report Abuse
AngryNeighbor is not online. AngryNeighbor
Joined: 27 Nov 2008
Total Posts: 113
12 Jul 2014 08:28 PM
I will ask around.
Report Abuse
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
12 Jul 2014 08:41 PM
You're not going to get a 2D gun for 100 robux, that's a very difficult thing to make.



★ +2k posts || R$1,153,796 ★
Report Abuse
MHebes is not online. MHebes
Joined: 04 Jan 2013
Total Posts: 2278
12 Jul 2014 08:53 PM
Eh, I've done more for free...
http://www.roblox.com/Watch-of-Power-item?id=165930484

was made because someone asked me to lol
Report Abuse
AngryNeighbor is not online. AngryNeighbor
Joined: 27 Nov 2008
Total Posts: 113
12 Jul 2014 11:08 PM
Now offering 500 to anyone, and 1000 to MHebes becasue he has helped so much.
I may have an answer one second...
Report Abuse
AngryNeighbor is not online. AngryNeighbor
Joined: 27 Nov 2008
Total Posts: 113
12 Jul 2014 11:10 PM
MHebes, ArbiterofDeath said:

I think what you are looking for is the mouse.X and the mouse.Y properties. If not then try this:

local function getVector2(camera, vector3)
vector3 = camera.CoordinateFrame:Inverse() * vector3
return Vector2.new(vector3.x, vector3.y)
end
Report Abuse
Jetta765214 is not online. Jetta765214
Joined: 22 Oct 2008
Total Posts: 1855
12 Jul 2014 11:15 PM
If you want the gun to point towards the mouse, you can so something similar to:

function rotateGun()
local mousePos = Vector2.new(mouse.X,mouse.Y)
local gunPos = --Vector2 position
local localPos = (mousePos-fishPos).unit
rot = math.atan2(localPos.Y,localPos.X)
local rotation = math.deg(rot)
return rotation
end

Alt. of Jetta765214
Report Abuse
AngryNeighbor is not online. AngryNeighbor
Joined: 27 Nov 2008
Total Posts: 113
12 Jul 2014 11:16 PM
LegendaryAccount,
That gun is exactly what i am looking for.
Report Abuse
AngryNeighbor is not online. AngryNeighbor
Joined: 27 Nov 2008
Total Posts: 113
12 Jul 2014 11:18 PM
Jetta I will try that.
Also, i saw above someone paraphrase what I said quite well.
where the gun faces the same way but follows the cursor and only does 180 degrees
Report Abuse
MHebes is not online. MHebes
Joined: 04 Jan 2013
Total Posts: 2278
12 Jul 2014 11:21 PM
No I get exactly what you mean, I'm working on it now.

Jetta,

"local gunPos = --Vector2 position"
That position is the problem. It's a 3D game that he's made look 2D - we need a function that can figure out where the gun is in 2D


"local localPos = (mousePos-fishPos).unit"
Fishes have no place here lol
Report Abuse
Jetta765214 is not online. Jetta765214
Joined: 22 Oct 2008
Total Posts: 1855
12 Jul 2014 11:24 PM
Ya, I made a fish game where the fish points toward the mouse for a person, so I just copied and pasted... Thought I had changed all the variables to gun.

Anyway, it's not that hard to transfer the rotation number into a 3d rotation

gun.CFrame = gun.CFrame*CFrame.Angles(rotation,0,0)

if rot is radians that is, and it is rotated around the correct axis.

Alt. of Jetta765214
Report Abuse
SyndicateHalo is not online. SyndicateHalo
Joined: 23 Mar 2013
Total Posts: 2948
12 Jul 2014 11:32 PM
http://www.roblox.com/Late-Forums-place?id=16484662




check the owner's badges
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