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
 

[ Content Deleted ]

Previous Thread :: Next Thread 
ss1122 is not online. ss1122
Joined: 16 Dec 2008
Total Posts: 1601
28 Aug 2011 06:35 AM
[ Content Deleted ]
Report Abuse
crazypotato4 is not online. crazypotato4
Joined: 22 Feb 2010
Total Posts: 20000
28 Aug 2011 06:46 AM
--i know barely anything about cframe, so i am most likely wrong

x = torso.CFrame:toObjectSpace(rocket.CFrame).X
if x > 0 then
--idk, it's on the right or something
else
--left i think
end

.:Like a boss:.
Report Abuse
NXTBoy is not online. NXTBoy
Joined: 25 Aug 2008
Total Posts: 4533
28 Aug 2011 06:46 AM
Are you looking for which side the rocket will be on, or which side it is currently on, or whether it is moving left or right?

For the second case:

local rocketCF, torsoCF = ...

local relativeCF = torsoCF:toObjectSpace(rocketCF)
local sidewaysness = relativeCF.p.x

local side = sidewaysness < 0 and "left" or "right"
Report Abuse
NXTBoy is not online. NXTBoy
Joined: 25 Aug 2008
Total Posts: 4533
28 Aug 2011 06:47 AM
> --i know barely anything about cframe, so i am most likely wrong
>
> x = torso.CFrame:toObjectSpace(rocket.CFrame).X
> if x > 0 then
> --idk, it's on the right or something
> else
> --left i think
> end
>
> .:Like a boss:.

Darn, beat me to it
Report Abuse
ss1122 is not online. ss1122
Joined: 16 Dec 2008
Total Posts: 1601
28 Aug 2011 06:54 AM
[ Content Deleted ]
Report Abuse
ss1122 is not online. ss1122
Joined: 16 Dec 2008
Total Posts: 1601
28 Aug 2011 06:56 AM
[ Content Deleted ]
Report Abuse
crazypotato4 is not online. crazypotato4
Joined: 22 Feb 2010
Total Posts: 20000
28 Aug 2011 06:59 AM
--for the first case (i know this is a latepost, but i did it already so i'm posting it >:o)

local rocketcf, torsocf = ?
local ray = Ray.new(rocketcf.p, rocketcf.lookVector*(torsocf.p-rocketcf.p).magnitude)
local point = ray:ClosestPoint(torsocf.p)
local newcf = CFrame.new(point) * (rocketcf - rocketcf.p)
local x = torsocf:toObjectSpace(newcf).X
if x > 0 then
--right
else
--left (or it could be right at the same x as the torso)
end

--? :D

.:Like a boss:.
Report Abuse
NXTBoy is not online. NXTBoy
Joined: 25 Aug 2008
Total Posts: 4533
28 Aug 2011 07:02 AM
--for the first case (i know this is a latepost, but i did it already so i'm posting it
local rocketcf, torsocf = ?
local ray = Ray.new(rocketcf.p, rocketcf.lookVector*(torsocf.p-rocketcf.p).magnitude)
local point = ray:ClosestPoint(torsocf.p)
local newcf = CFrame.new(point) * (rocketcf - rocketcf.p)
local x = torsocf:toObjectSpace(newcf).X
if x > 0 then
--right
else
--left (or it could be right at the same x as the torso)
end

Try and indent your code by four spaces next time so us forum enhancer users get syntax highlighting.

Report Abuse
crazypotato4 is not online. crazypotato4
Joined: 22 Feb 2010
Total Posts: 20000
28 Aug 2011 07:03 AM
pretty sure that the roblox forum doesn't let me do four spaces at once

and i don't like your forum enhancer thingy, it sounds dumb

*resists change*

.:Like a boss:.
Report Abuse
NXTBoy is not online. NXTBoy
Joined: 25 Aug 2008
Total Posts: 4533
28 Aug 2011 07:04 AM
It really isn't dumb. Code formatting on a scripters forum is not dumb. At least try it

Besides, you can still type the four spaces in the edit box. They'll only be visible to us, but roblox does save them.
Report Abuse
ss1122 is not online. ss1122
Joined: 16 Dec 2008
Total Posts: 1601
28 Aug 2011 07:16 AM
[ Content Deleted ]
Report Abuse
ss1122 is not online. ss1122
Joined: 16 Dec 2008
Total Posts: 1601
28 Aug 2011 07:20 AM
[ Content Deleted ]
Report Abuse
ss1122 is not online. ss1122
Joined: 16 Dec 2008
Total Posts: 1601
28 Aug 2011 07:26 AM
[ Content Deleted ]
Report Abuse
ss1122 is not online. ss1122
Joined: 16 Dec 2008
Total Posts: 1601
28 Aug 2011 07:33 AM
[ Content Deleted ]
Report Abuse
ss1122 is not online. ss1122
Joined: 16 Dec 2008
Total Posts: 1601
28 Aug 2011 07:41 AM
[ Content Deleted ]
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