Alright, let me explain the concept of this whole thing first.
Script creates a part and launches that part with a speed. (mph)
Part keeps going in that direction indefinitely.
I already have a script for that:
local speed = 10
local direction = Vector3.new(1, 0, 0)
-- Create the part
local part = Instance.new("Part")
part.Size = Vector3.new(2, 2, 2)
part.CFrame = CFrame.new(Vector3.new(0, 10, 0))
part.Parent = workspace
while task.wait() do
local displacement = direction * ((speed * 1609.34) / 3600)
part.CFrame = part.CFrame + displacement
end
Now I have absolutely no idea how I am gonna create this next bit.
Part collides with an object
Depending on the speed, the object takes damage.
An example would be the part colliding with the Earth at the speed of light, it would surely do a lot of damage because of the speed. How would I create that? Is it even possible?
Check the speed of the object, or there’s any Vekocity object it should show it, after that make an equation (ex. damage = speed * (speed / 3) / toughness) and from here calculate the damage, for the colliding use .Tocuhed, even through if it’s too fast it might not even fire
For that there’s probably 1 ways:
The part is grouped under a model, and the part has many different parts, you would get the part that collided, after that you would get based on the force of the impact the parts that are touching taht part, if it’s low damage then you will probably destroy only one part, if it’s more you will destroy more, etc.
That’s all I ci il think of
Also, if you want the part to bounce, I think you would have to do some raitracing, like, the ray goes in one direction, at a 45 degrees angle, it should bounce at a -45 degrees direction, to do that I would make a raycast and check at which angle it gets, if it’s positive then the bounce angle would be negative and vice versa, and you also want the speed to decrease, I think the equation would be something like: