Hello, Danki here. I’m trying to make a bullet-hell game, but i have problems with lining up the 3D collision tests (parts) with what the client sees!
Client POV:
The server collision tests: (rotation is working fine im just worried about the size)
The problem is the client sees everything much closer/bigger than it is.
Here’s the code which creates the projectile thingies and positions them, runs every frame:
for i,v:Configuration in projectiles:GetChildren() do
if not projectileLabelExists(v.Name) then
local new = Instance.new("ImageLabel",gui.Fight.Frame)
new.Name = v.Name
local image
local find = ReplicatedFirst.Projectiles:FindFirstChild(v:GetAttribute("Shape"))
if not find then image = ReplicatedFirst.Projectiles.Square.Image else image = find.Image end
new.AnchorPoint = Vector2.new(.5,.5)
new.BackgroundTransparency = 1
new.Image = image
table.insert(projectileLabels,new)
end
for i,v in projectileLabels do
local info:Configuration = battleInfo.Projectiles:FindFirstChild(v.Name)
if not info then v:Destroy() projectileLabels[i] = nil end
local size = info:GetAttribute("Size")
local pos = info:GetAttribute("Position") or Vector2.zero
local rot = info:GetAttribute("Rotation") or 0
local mult = math.round(viewportSize.X/48.424)/8
v.Size = FrameSizeToScale(size,v.Parent.AbsoluteSize/mult)
local framePos = gui.Fight.Frame.Position
v.Position = UDim2.fromScale(pos.X/frameSize.X,pos.Y/frameSize.Y)
v.Rotation = rot
end
end
Any help would be appreciated!