I passed on a variable that contains a part's position 'pos' and the remote event cant seem to do this (pos = part.Postion on script firing variable)
1 | part.Position = pos |
This must be an error and here is the rest of code for review
01 | local Remote = game.ReplicatedStorage.wall |
02 |
03 | Remote.OnServerEvent:Connect( function (playerWhoFired, o ,pos, pos 2 , pos 3 ) |
04 | local part = Instance.new( "Part" ) |
05 | print ( "Fired" ) |
06 | part.Anchored = true |
07 | part.Size = Vector 3. new( 31.77 , 16.8 , 2 ) |
08 | part.Position = pos |
09 | part.Parent = game.Workspace |
10 | part.Name = "Wall" |
11 | part.BrickColor = BrickColor.new( "Dark orange" ) |
12 | part.Material = Enum.Material.WoodPlanks |
13 | end ) |
roblox automatically tries to make no parts collide when the Position property is set, same with Size and Orientation. the simple fix is to operate on the CFrame instead of the Position or Orientation property after setting the size
01 | local Remote = game.ReplicatedStorage.wall |
02 |
03 | Remote.OnServerEvent:Connect( function (playerWhoFired, o ,pos, pos 2 , pos 3 ) |
04 | local part = Instance.new( "Part" ) |
05 | print ( "Fired" ) |
06 | part.Anchored = true |
07 | part.Size = Vector 3. new( 31.77 , 16.8 , 2 ) |
08 | part.CFrame = CFrame.new(pos) -- changed line |
09 | part.Parent = game.Workspace |
10 | part.Name = "Wall" |
11 | part.BrickColor = BrickColor.new( "Dark orange" ) |
12 | part.Material = Enum.Material.WoodPlanks |
13 | end ) |