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

(Vector3/CFrame) How do i manipulate a part to not go on top of a character?

Asked by
PropzFx 27
6 years ago

Im working on a minigame where you need to jump to avoid the laser. Everything works except when the laser touches the character its going ontop of the player and i want to to continue through heres what i got: I tried to use cframe but either i get errors (cuz i dont know how to use it in line 25) or the laser movement goes crazy

lock = false
game.ReplicatedStorage.LaserJumpEvent.Event:Connect(function()
    if lock == false then
        lock = true
        while lock do
        --Kod för när gamet har börjat

local laser2 = script.Parent
laser2.Position = Vector3.new(-202.1, 16, -175)
local laserSpeed2 = math.random(3,6)
local laserDelay2 = math.random(1,3)
local waitTime = laserDelay2 + laserSpeed2 * 2

local tweenService = game:GetService("TweenService")

--Laser2 TweenService
local tweenInfo2 = TweenInfo.new(

    laserSpeed2,
    Enum.EasingStyle.Linear,
    Enum.EasingDirection.In,
    0,
    true,
    laserDelay2
)

local tween2Start = tweenService:Create(laser2, tweenInfo2, {Position = Vector3.new(-86.1, 16, -175)})
tween2Start:Play()
wait(waitTime)
end
    else
        lock = false
    end
end)
0
Try making the laser CanCollide, I'm not sure thought. I'll try to figure it out. hopup 15 — 6y

Answer this question