#DBD generator approach stuff

1 messages · Page 1 of 1 (latest)

tawny mason
#

So i'm making like a dbd game and whatever.

Should i just have one prompt, and when they get on generator it checks which side is closest to player, and check if theres a wall.

Or should i have like 4 set positions that it tps the player to "work", and just check if the set position is in a wall and remove it.

#

and is it even possible to check which face of the object is closest

charred trout
#

Just a suggestion, have 4 highlighted circles and a prompt on whatever side they're standing on, then make them "work" on the closest circle they're on

copper muralBOT
#

studio** You are now Level 2! **studio

charred trout
#
-- indicate your part & point
local part = workspace.Part
local point = Vector3.new(0, 10, 0)

-- then put ur point into a space rel to the part
local relative = part.CFrame:PointToObjectSpace(point)

-- then adjust the rel position by the part size
local normalized = relative / (part.Size / 2)

-- find the axis that has the most magnitude in it
local absX, absY, absZ = math.abs(normalized.X), math.abs(normalized.Y), math.abs(normalized.Z)

-- now set a variable for the so called "closest face or whatever"
local findClosestFace

if absX > absY and absX > absZ then
  findClosestFace = normalizex.X > 0 and Enum.NormalId.Right or Enum.NormalId.Left
elseif absY > absZ then
  findClosestFace = normalized.Y > 0 and Enum.NormalId.Top or Enum.NormalId.Bottom
else
  findClosestFace = normalized.Z > 0 and Enum.NormalId.Back or Enum.NormalId.Front
end

print(findClosestFace.Name)
charred trout
#

directory for the script depends

#

if you want all the players to see or interact with your gen

#

like for placing objects, damage detection, or any effects

#

put it into

#

ServerScript Service > FaceCheckScript ( Script )

#

or can also be

#

Workspace > Part > FaceCheck script ( Script )

#

But if you want it to be entirely visual for a player

#

like UI indicators or like any local effects

#

then

#

StarterPlayer > StarterPLayerScripts > FaceCheckScript ( Local )

tawny mason
charred trout
#

lemme show u a ref

tawny mason
#

Oh

charred trout
#

Just to show indication on where the player is going to be

#

At least that way they don't just get "Teleported" which may cause like deaths

#

At least that way they know where they're going to be teleported to

#

Just a recommendation though, since I've died or maybe lost things due to lack of indicators in some roblox games

tawny mason
#

ill keep that in mind

copper muralBOT
#

studio** You are now Level 20! **studio