|
| 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 |
|
|
| |
|
| |
|
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 |
|
|
|
| 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 |
|
|
|
| 27 Apr 2013 03:16 PM |
script.Parent.Torso.Position
Change the position...? |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 27 Apr 2013 03:24 PM |
| Ohhh, I didn't read that right. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 27 Apr 2013 03:34 PM |
| I will try that but...How in the world? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|