How to make an object fall until it hits something

I’m trying to make a meteor fall until it hits the baseplate. I’ve tried doing research, but I can’t find a solution to my problem.

Note: This is not a local script.

Once it hit something what would it do? Would it just pause

BasePartInstance.Touched:Connection(function(Hit)
--// What would u like it to do?
BasePartInstance.Anchored = true
end)

Resource - BasePart | Roblox Creator Documentation

Maybe try something that looks like this:
(This is only an example)

Put a script inside the meteor
The script should be something like the following:

script.Parent.Touched:Connect(function(touch)
if touch.name == “baseplate” then
script.parent.achored = true
end)

This is basic scripting that messes with the properties of apart. if this is not what you wanted then you can explain more about what you wanted. hope it helps.

I’m trying to make it fall steadily and sink slightly in to the ground. A good example of this would be [🎙️] Pass the Bomb - Roblox

1 Like

Are you saying you don’t like how it falls atm?

Is the ground falling on a Part or Roblox terrain?

BasePartInstance.Touched:Connection(function(Hit)
BasePartInstance.Anchored = true

local Pos = BasePartInstance.Position
BasePartInstance.Position = Vector3.new(Pos.X,Pos.Y - BasePartInstance.Size.Y/2,Pos.Z)
--// Position Line will embed what it falls in by 1 half of the projectile size

end)

so you want it so sink SLOWLY into the ground when it hit’s a part? You can do that, very simple, just use the same “Touched” function technique I said and use tween services to move the meteror underground. You might have to turn cancollide on the meteor on and off but you can figure it out a way. It might of made more sense and seem more simple in my head but hope it gives you and idea.

Why not just raycast from the meteors initial position down. E.g you raycast 500 studs (or whatever amount you want) down, if it detects a BasePart, simply just tween the meteor from the initial position to the part it hits at whatever speed you want.

Touched events might be inaccurate and can sometimes not fire if the projectile is moving fast, so keep that in mind.

1 Like

It’s a part:
thing for devfroumfr
Also, I need to get the meteors from ReplicatedStorage
Meteor dev forum

1 Like
--[[To save performance and being able to have more control over them, 
we're going to use our own "physics" system
:GetPartBoundsInBox() is a function which allows to detect 
collisions, without .touch and is much cleaner]]
local YourObject = workspace.Part
local GravityPull = 0.01
local Yacceleration = 0
local RunService = game:GetService("RunService")
RunService.Heartbeat:Connect(function(deltaTime)
	local Size = YourObject.Size
	local Mass = YourObject:GetMass()
	Yacceleration += Mass * deltaTime * GravityPull
	local CFrame = YourObject.CFrame
	local CollisionParts = workspace:GetPartBoundsInBox(CFrame,Size)
	if #CollisionParts > 1 then --collision is true and 1 because we are already colliding with an astreoid
		print("collision detected")
	else 
		print("did not collide with any object")
		YourObject.CFrame += Vector3.new(0,-Yacceleration*deltaTime,0)
	end
end)

It just looks like the object is unanchored, it bounces when it hits the ground, and it doesn’t print anything.

Are you sure that the YourObject has been declared?
And anchor the object.
Another thing is, that it won’t work in local script outside of a character or player.

Yes, I am sure.
The object just sits there when it is anchored.
It’s a server script in ServerScriptService.

Is there a way to say:

Move from point A.
to
Point B.
In a specified amount of time?

That would be ideal for me

image

t = s / v

Simple formula, i’m pretty sure that you had classes about it.

How do I do that through scripting?

I don’t want to offend you, but you need to learn basics of scripting in lua.

I understand the basics. I think I’m probably just misunderstanding you.

time = distance / speed
Is it clear?

Yes! However, I’m not sure how to make that work through scripting. Would you mind explaining?

Sorry for the trouble.