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: Raycasting Again...

Previous Thread :: Next Thread 
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
27 Apr 2013 01:41 PM
So when i use this it makes a ray out of the back of the torso
GetRayCollision(NewRay(script.Parent.Torso.Position,script.Parent.Torso.CFrame.lookVector*-300),{script.Parent})

I was wondering how i would get the ray to come out of the right or left of the torso?
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
27 Apr 2013 01:45 PM
Bumpy
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
27 Apr 2013 03:07 PM
Bump
Report Abuse
getkoed2 is not online. getkoed2
Joined: 11 Apr 2010
Total Posts: 1144
27 Apr 2013 03:13 PM
Just play with the -300
idk what number should work
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
27 Apr 2013 03:15 PM
Huh? 300 is the distance for the ray to travel. I used -300 so it would go out backwards...playing with that number won't make it point left or right.
Report Abuse
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
27 Apr 2013 03:16 PM
script.Parent.Torso.Position

Change the position...?
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
27 Apr 2013 03:18 PM
My ghetto idea.

Weld a brick inside your torso pointing the way you'd like and originate your point from that instead. Since lookvector is the front of a bricks face I don't know how else you could achieve that.
Report Abuse
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
27 Apr 2013 03:24 PM
Ohhh, I didn't read that right.
Report Abuse
chaoticregandpledge is not online. chaoticregandpledge
Joined: 04 Dec 2009
Total Posts: 2894
27 Apr 2013 03:31 PM
GetRayCollision(NewRay(script.Parent.Torso.Position, script.Parent.Torso.CFrame*CFrame.Angles(0, math.rad(-90), 0) * script.Parent.Torso.CFrame:toObjectSpace(script.Parent.Torso.CFrame).lookVector*300),{script.Parent})

should work
--
http://www.roblox.com/Innocent-place?id=23319537 ~ Innocence
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
27 Apr 2013 03:34 PM
I will try that but...How in the world?
Report Abuse
chaoticregandpledge is not online. chaoticregandpledge
Joined: 04 Dec 2009
Total Posts: 2894
27 Apr 2013 03:36 PM
rotates the CFrame 90 degrees(to the right), then uses lookVector to cast the ray from the new direction.
--
http://www.roblox.com/Innocent-place?id=23319537 ~ Innocence
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
27 Apr 2013 03:43 PM
Yes that makes perfect sense I just don't know what your doing with the toObjectSpace stuff :/
Report Abuse
chaoticregandpledge is not online. chaoticregandpledge
Joined: 04 Dec 2009
Total Posts: 2894
27 Apr 2013 03:52 PM
Well, if the part(Torso) is rotated, and you rotate the CFrame using world coordinates, you won't maintain the correct orientation. You need to rotate the CFrame 90 degrees according to the part's object space, not world space.
--
http://www.roblox.com/Innocent-place?id=23319537 ~ Innocence
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