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 |
|
|
| |
|
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 |
|
|
|
| 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
|
  |
| 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
|
  |
| Joined: 17 Feb 2011 |
| Total Posts: 1326 |
|
| |
|
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 |
|
|
|
| 02 Nov 2012 12:32 PM |
You'll use a blockmesh and using coroutines to set the offset and the scale.
☜▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬☞ |
|
|
| Report Abuse |
|
|
spynaz
|
  |
| Joined: 17 Feb 2011 |
| Total Posts: 1326 |
|
|
| 02 Nov 2012 12:38 PM |
| What does blockmesh have to do with moving? |
|
|
| Report Abuse |
|
|
|
| 02 Nov 2012 12:52 PM |
| What would raycasting have to do with arrows? |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 17 Feb 2011 |
| Total Posts: 1326 |
|
| |
|