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

Previous Thread :: Next Thread 
spynaz is not online. spynaz
Joined: 17 Feb 2011
Total Posts: 1326
02 Nov 2012 10:54 AM
Hey, I made a raycasting script for my bow. How do I make the arrow slowly follow the raycasting path untill it hits the target to look like its flying?
Report Abuse
FreeToTake is not online. FreeToTake
Joined: 21 Apr 2010
Total Posts: 1827
02 Nov 2012 10:59 AM
BodyThrust.location
Report Abuse
spynaz is not online. spynaz
Joined: 17 Feb 2011
Total Posts: 1326
02 Nov 2012 11:15 AM
But what if I want my arrow to be anchored?
Report Abuse
FreeToTake is not online. FreeToTake
Joined: 21 Apr 2010
Total Posts: 1827
02 Nov 2012 11:22 AM
x = where the arrow should land
y = where the arrow should spawn
arrow = the arrow
sps = 10 (meaning it moves 10 studs per second)

for i = 1, (x - y).magnitude

arrow.CFrame = arrow.CFrame + arrow.CFrame.lookvector

wait(1/sps)

end
Report Abuse
spynaz is not online. spynaz
Joined: 17 Feb 2011
Total Posts: 1326
02 Nov 2012 11:25 AM
Will that work if the arrow was anchored? Also will I have to keep the raycasting part or not?
Report Abuse
spynaz is not online. spynaz
Joined: 17 Feb 2011
Total Posts: 1326
02 Nov 2012 11:55 AM
?
Report Abuse
spynaz is not online. spynaz
Joined: 17 Feb 2011
Total Posts: 1326
02 Nov 2012 12:10 PM
Oh I see, x would be the end of the raycasting and y would be the start
Report Abuse
Candymaniac is not online. Candymaniac
Joined: 08 Oct 2009
Total Posts: 8985
02 Nov 2012 12:32 PM
You'll use a blockmesh and using coroutines to set the offset and the scale.

☜▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬☞
Report Abuse
spynaz is not online. spynaz
Joined: 17 Feb 2011
Total Posts: 1326
02 Nov 2012 12:38 PM
What does blockmesh have to do with moving?
Report Abuse
FreeToTake is not online. FreeToTake
Joined: 21 Apr 2010
Total Posts: 1827
02 Nov 2012 12:52 PM
What would raycasting have to do with arrows?
Report Abuse
opplo is not online. opplo
Joined: 09 Dec 2008
Total Posts: 5320
02 Nov 2012 12:55 PM
Candy's idea was actually very good.

You just use the offset of the mesh along the line of the ray to make it look as if it's moving.
Report Abuse
Candymaniac is not online. Candymaniac
Joined: 08 Oct 2009
Total Posts: 8985
02 Nov 2012 01:01 PM
I actually use that method to simulate bullets, and people still think I haven't used raycasting, haha!

My method doesn't involve that much, and it was pretty much taken from Youtube's Bullet Raycast Move (whatever name) script.

☜▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬☞
Report Abuse
spynaz is not online. spynaz
Joined: 17 Feb 2011
Total Posts: 1326
02 Nov 2012 01:24 PM
@candy, ok
@free, the artemis bow is a raycasting script :P
Report Abuse
spynaz is not online. spynaz
Joined: 17 Feb 2011
Total Posts: 1326
02 Nov 2012 01:29 PM
Idk how that method works so can you please explain?
Report Abuse
spynaz is not online. spynaz
Joined: 17 Feb 2011
Total Posts: 1326
02 Nov 2012 02:47 PM
Bump
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