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

Is there any way to use a Vector3 to resize and use a .Touched while being in another part?

Asked by 9 years ago

I have tried pretty much everything but there must be some way. I have seen it before but I cant figure out how to keep it in another part. I have tried welding body positions and CFrames.

if key=='q' and almost then
            print('move')
            starting=false
            almost=false
            going=false
            local point=Instance.new('Part',game.Workspace)
            point.Anchored=true
            point.CanCollide=false
            point.Size=Vector3.new(2,2,2)
            local x=character.Torso.Position.X
            local y=character.Torso.Position.Y
            local z=character.Torso.Position.Z
            point.Shape='Ball'
            point.Transparency=.5
            point.BrickColor=BrickColor.new('Really black')
            character.Torso.CFrame=character.Torso.CFrame*CFrame.new(0,2,-20)
            point.Position=Vector3.new(x,y,z)
            for i=1,6 do
                local sphere=Instance.new('Part',game.Workspace)
                sphere.Shape='Ball'
                sphere.BrickColor=BrickColor.new('Really black')
                sphere.Transparency=.5
                sphere.CanCollide=false
                sphere.Size=Vector3.new(2,2,2)
                sphere.CFrame=point.CFrame
                sphere.Touched:connect(function()
                    print('i')
                end)
                for a=1,10 do
                    sphere.Size=sphere.Size+Vector3.new(1,1,1)
                    sphere.Transparency=sphere.Transparency+.05
                    wait(.025)
                end
                sphere:remove()
                wait(.5)
            end
            point:remove()
        end

This is just a small bit of it. This is the area in which the problem is.

0
Point goes to where it should be but sphere just grows on top of point. My goal is to make sphere grow inside of point. User#600 0 — 9y
0
I dont really have to use any of those except that I have to be able to deal damage to a target that touched it as well as making it expand User#600 0 — 9y
0
How much lag would be created if I were to get the distance from the point to every character every 10th of a second? User#600 0 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

Im going to use magnitude to get the distance to the other characters every so often and when they get to close they take damage.

0
love the fact that i can answer my own question xD User#600 0 — 9y
0
IT WORKED! User#600 0 — 9y
Ad

Answer this question