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: (Arrow.CFrame.lookVector)

Previous Thread :: Next Thread 
brayden99 is not online. brayden99
Joined: 30 Sep 2007
Total Posts: 1243
19 Nov 2012 11:10 PM
Right now this shoots a ray from the front of the arrow, How can I make it shoot from diffrent angles such as the bottom?


local ray = Ray.new(Arrow.Position, (Arrow.CFrame.lookVector).unit * 3)
local Hit, Pos = Workspace:FindPartOnRay(ray, Arrow)
Report Abuse
MrChubbs is not online. MrChubbs
Joined: 14 Oct 2010
Total Posts: 4969
19 Nov 2012 11:12 PM
Arrow.CFrame.lookVector:cross(Vector3.new(0,1,0)) --[[ turns right, -1 left, modify the Vector3 more for other angles.]]
Report Abuse
brayden99 is not online. brayden99
Joined: 30 Sep 2007
Total Posts: 1243
19 Nov 2012 11:14 PM
local ray = Ray.new(Arrow.CFrame.lookVector:cross(Vector3.new(0,1,0))

This look right?
Report Abuse
MrChubbs is not online. MrChubbs
Joined: 14 Oct 2010
Total Posts: 4969
19 Nov 2012 11:16 PM
No add Arrow.Position, infront of the lookVector piece then multiply the lookVector by how far you want the ray to go.
Report Abuse
brayden99 is not online. brayden99
Joined: 30 Sep 2007
Total Posts: 1243
19 Nov 2012 11:20 PM
local ray = Ray.new(Arrow.Position, Arrow.CFrame.lookVector:cross(Vector3.new(0,1,0.unit * 3))


Good?
Report Abuse
brayden99 is not online. brayden99
Joined: 30 Sep 2007
Total Posts: 1243
19 Nov 2012 11:21 PM
Sorry, I ment

local ray = Ray.new(Arrow.Position, Arrow.CFrame.lookVector:cross(Vector3.new(0,1,0).unit * 3))
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