Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Trying To Make A Airdrop Mechanic With Raycasting?

Asked by 3 years ago

Hello, I Am Trying To Make A Airdrop Mechanic That Uses Raycasting To Move A Supply Box Down.

I Have Tried Using Some Raycasting Math Methods And All Of Them Are Wrong.

I Want The Box To Raycast Downwards Infinitely Until It Hits Something.

And Then It Tweens The Box To That Position

The Tweening Code Works Just Not The Raycasting.

It Moves But To The Left ????

Here is My Code.

Please Help Me Out!

local part = script.Parent  

local ts = game:GetService("TweenService")

local new_ray = Ray.new(part.Position,-part.CFrame.UpVector*5000)

local part,position = game:GetService("Workspace"):FindPartOnRay(new_ray)

print(part,position)

local info = TweenInfo.new(
    5,
    Enum.EasingStyle.Linear,
    Enum.EasingDirection.Out,
    0,
    false,
    0
)

local goal = {
    Position = position
}

local tween = ts:Create(script.Parent,info,goal)


wait(2)
tween:Play()

Also Here Is A Video Of The Airdrop https://rumble.com/vmbzow-bruh.html

0
Update: I Got It Working But Now Its Half Under The Map :( CallMe_Axis 63 — 3y

Answer this question