-
**What do you want to achieve?: I need some help making this model move, im trying too make an infinite road trip game type of game.
-
**What is the issue?: just need too make this model move like in this rbxl file (found it in forums, didnt help.)
Moving Thing.rbxl (77.2 KB)
- **what did you try?: I tried using the built in assistant on roblox studio but it gave me this script
local Workspace = game:GetService("Workspace")
local Players = game:GetService("Players")
-- Function to move the model to the player's position
local function moveToPlayerPosition(model, playerPosition)
local modelCFrame = model:GetPivot()
local newPosition = CFrame.new(playerPosition.X, modelCFrame.Y, playerPosition.Z)
model:PivotTo(newPosition)
end
-- Function to handle the touch event
local function onTouch(hit)
local player = Players:GetPlayerFromCharacter(hit.Parent)
if player then
local model = Workspace:FindFirstChild("Baseplate")
if model then
moveToPlayerPosition(model, player.Character:GetPivot().Position)
end
end
end
-- Main
local baseplate = Workspace:FindFirstChild("Baseplate")
if baseplate then
-- Assuming the baseplate is a Model with multiple parts
for _, part in ipairs(baseplate:GetDescendants()) do
if part:IsA("BasePart") then
part.Touched:Connect(onTouch)
end
end
end
It didnt work, it only rotated the model 90 degrees, and it made it move, wherever i moved