#rahhhhhh
236 messages · Page 1 of 1 (latest)
lets go back to the drawing board
alright
theres 2-3 things you need
to know
Raycast, Magnitude Checks and Atan2
I'll guide you thru the Atan2
since its math
but everything else u should be able to handle if u are a scripter
theyre not math
atan2 and not dot?
i didnt invite you here
so this is our entity
facing upwards
ok
it has a magnitude of 50 studs
so anything within 50 studs of itself
it should be able to detect
and for that
local WithinRadar = {}
for _, Character in Characters --[[ make a table w all the characters or sum]] do
if (Character.PrimaryPart.Position - Bot.PrimaryPart.Position).Magnitude > 50 then continue end
table.insert(WithinRadar, Character)
end```
ok
so with this
you can detect every enemy 50 studs
heres your view now
as i referenced befoire
your npc is hellen keller until you program it not to be
now we've detected every single enemy within a range
that we want
now first we want to simply the grapth to its lowest
before we can raycast
so we atan2
what atan2 basically does is
whatever the fuck this is
right
and repertor helped me with this
for my tower defense so
atan2 returns how much x,y is rotated from 0,0 in radians
local LookCFrame = Bot.PrimaryPart.CFrame
local Rx, Ry, Yz = LookCFrame:ToOrientation()
local AttackingEnemies = {}
for _, Character in WithinRadar do
local Delta = (Character.PrimaryPart.Position - Bot.PrimaryPart.Position)
local Angle = math.atan2(-Delta.X, -Delta.Z)
local DiffAngle = (Angle - Ry) % (2 * math.pi)
if DiffAngle > math.pi then
DiffAngle = (math.pi * 2) - DiffAngle
end
if math.abs(DiffAngle) < math.rad(15) then
table.insert(AttackingEnemies, Character)
end
end```
** You are now Level 7! **
Character is every other character in the game
beside the bot
Bot.PrimaryPart.Position is the Bot's humanoidRoot position
your filling that table up
with all your characters
for _, Player in game:Players:GetPlayers() do
if not Player.Character then continue end
table.insert(Characters, Player.Character)
end```
ok back on track
math.rad(15) is in radians how much of the coverage u want
so 15 would look something like thius
i think
where as 90 would be halfway thru I believe?
I dont know much atan2 either
@clever wing i think ur severely overcomplicating by using atan2 instead of dot?
when I first tried dot vs atan2 as for calculation
creating a whole another vector and yap yap was extra
- thought as more resource intensive
yeah u can do dot
but dis calculation is sum light too
fair enough then
u can go both ways
obviously
Im just teaching him what I did
dosnt mean he has to follow it step by step
ok so now that we create that cone type range
and we have filtered out every enemy that isnt in this cone
typo
didnt fix it was copying from my TD's code
this is what your left with now
and the final step
for you
is to raycast
I'll provide 2 instances
but I wont go over raycast
u got it
Instance 1
theres a wall infront of the player
Instance 2
theres a wall but opening
now you want to racyast
from the Bots Rootpart Position to the Characters position
and if theres any type of instance within, using RaycastFilter
you dont hit them
right and theres tons of tutorials about racyast and raycast filtering
yes we did
we went thru all the charaacters table
and then we filtered them out
@pliant bladedot would be easier
ur right
but yeah wtv wtv
.
heres for that
you need to piece these codes together
and create your own snippet
right im js showing u the steps
after you raycast
and theres nothing between your ai and the character ur tryng to kill
your going to make the ai look at the character
you can lerp that, change cframe
dude
this script fulfills it
and on top
I have a comment saying make a table w all the characters
well because u didnt spawn yet
you need to put this code in some type of detection loop
no because ur character takes time to load
it dosnt happen in 1 sec
and then shoot it
oh my goodness it worksss 
i think i understand atan2 a bit now

but yeah this basically it
and if he did follow the steps
and ray casted
if there was something in his way there would be no highlight
and he can increase this to widen the range of the cone
okie
u need to uh
learn more basics of scripting as well
before endevearing in these wild places
well
u dont
you cant really put together different snippets
right and my snippets had tables
they werent always full
but like obv u had to piece them together as well
das how u learn lowkey
just printing istn the basics
once u know how to put together you'll learn a lot
@void pendant
imma add u on my alt
cuz i love u so much
well first u need to know how they are used
raycast sends a 2d ray
thru a 3d world
and on the rendering level sees what it interacts with and sends that data back on roblox terms
exactly so you know
it can be used to see if there is a wall
between you and an enemy
then you dont know Raycast
yeah so now whenveer you need to check if theres something between you and another player
you fire a raycast
with the set properties
and see if there is
i js told u where to put it
and how to implement it
to check if there is something between you and your goal
there are many other ways it can be used too
learn more to debug and stuff
do simpler stuff until ur fluent or sum idk
idrk how i became good
@fluid spindle send the code
then you meet in the middle
go play roblox games
and see what seems easy
that you can replicater
try replicating
try making a pet system that follows you
ima send it in pastebin hold up
local Player = game.Players.LocalPlayer
local Character = Player.Character
local Bots = game.Workspace:FindFirstChild("bots")
function GetWithin()
local withinradar = {}
for _, bot in Bots:GetChildren() do
if (bot.PrimaryPart.Position-Character.PrimaryPart.Position).Magnitude <= 20 then
table.insert(withinradar, bot)
end
end
return withinradar
end
function F()
game.Workspace:FindFirstChild("highlights"):ClearAllChildren()
local WithinRadar = GetWithin()
local LookCFrame = Character.PrimaryPart.CFrame
local Rx, Ry, Yz = LookCFrame:ToOrientation()
local AttackingEnemies = {}
for _, bot in WithinRadar do
local Delta = (bot.PrimaryPart.Position - Character.PrimaryPart.Position)
local Angle = math.atan2(-Delta.X, -Delta.Z)
local DiffAngle = (Angle - Ry) % (2 * math.pi)
if DiffAngle > math.pi then
DiffAngle = (math.pi * 2) - DiffAngle
end
if math.abs(DiffAngle) < math.rad(15) then
local rayparams = RaycastParams.new()
rayparams.FilterDescendantsInstances = {Character}
rayparams.FilterType = Enum.RaycastFilterType.Exclude
local ray = game.Workspace:Raycast(Character.PrimaryPart.Position, (bot.PrimaryPart.Position-Character.PrimaryPart.Position), rayparams)
if ray then
print(ray.Instance.Parent)
if ray.Instance.Parent == bot then
table.insert(AttackingEnemies, bot)
local highlight = Instance.new("Highlight")
highlight.Parent = game.Workspace:FindFirstChild("highlights")
highlight.Adornee = bot
end
end
end
end
print(AttackingEnemies)
end
you would fire function F every heartbeat or in a while loop and when they arent in rangge youd remove their highlight
thats p much it
or he js clears higlight everytime
bro 300 comments gang 💀 🤣
@everyone
local Player = game.Players.LocalPlayer
local Character = Player.Character
local Bots = game.Workspace:FindFirstChild("bots")
function GetWithin()
local withinradar = {}
for _, bot in Bots:GetChildren() do
if (bot.PrimaryPart.Position-Character.PrimaryPart.Position).Magnitude <= 20 then
table.insert(withinradar, bot)
end
end
return withinradar
end
function F()
game.Workspace:FindFirstChild("highlights"):ClearAllChildren()
local WithinRadar = GetWithin()
local LookCFrame = Character.PrimaryPart.CFrame
local Rx, Ry, Yz = LookCFrame:ToOrientation()
local AttackingEnemies = {}
for _, bot in WithinRadar do
local Delta = (bot.PrimaryPart.Position - Character.PrimaryPart.Position)
local Angle = math.atan2(-Delta.X, -Delta.Z)
local DiffAngle = (Angle - Ry) % (2 * math.pi)
if DiffAngle > math.pi then
DiffAngle = (math.pi * 2) - DiffAngle
end
if math.abs(DiffAngle) < math.rad(15) then
local rayparams = RaycastParams.new()
rayparams.FilterDescendantsInstances = {Character}
rayparams.FilterType = Enum.RaycastFilterType.Exclude
local ray = game.Workspace:Raycast(Character.PrimaryPart.Position, (bot.PrimaryPart.Position-Character.PrimaryPart.Position), rayparams)
if ray then
print(ray.Instance.Parent)
if ray.Instance.Parent == bot then
table.insert(AttackingEnemies, bot)
local highlight = Instance.new("Highlight")
highlight.Parent = game.Workspace:FindFirstChild("highlights")
highlight.Adornee = bot
end
end
end
end
print(AttackingEnemies)
end
game:GetService("RunService").Heartbeat:Connect(function()
F()
end)
its with three `
wouldnt work
render step is on client
u wantbot detection server side not client
mb forgot to change
do .Heartbeat
i wish i could be s2 like this dude

i was testing on local script 
i made procedral planet generation and marching cubes system for it lol
looks tuff
yee im tryna make a roblox version of astroneer and make it free and higher quality using editable images and mesh
In this video, you are going to learn how to use Editable Image and how to generate images with it.
Besides that, I spent some time doing a very special project that will allow you to import videos to roblox (in the future), but now it can compress images to the string, and with a couple of modules you will be able to decompress it back.
Place:...
boom 2d game
yay
ok then use the roblox platformer game use the code from that game and put it into yours\
it has camera lock system
ez fix
soooo umm what you know about procedural movement 
u mean like IK bones and ragdolls?
foot planting ye
leme find a vid for u
im using this module that for r6 IK because i was a lil slow on figuring it myself but ummm im not sure how to do the stepping likeee im guessing it has to do with using sine waves
In this video you'll learn how to easily make procedural animations in Roblox using these 4 steps. I hope you enjoy the video!
RigEdit Lite:
https://create.roblox.com/store/asset/1274343708/RigEdit-Lite
My procedural animation module: https://create.roblox.com/store/asset/17842459894/Proce...
Inverse kinematics is the mathematical process of calculating the variable joint parameters needed to place the end of a kinematic chain.
Become a member for great Channel and Discord perks!: https://www.youtube.com/channel/UCmIFjYx2aXrTjy5H8Zz1IfA/join
Discord Server: https://discord.gg/Fk8CF67RE7
If the invite doesn't work, try it from here:...
Today i will show you how to make a basic footplanting code in roblox studio! The potential of inverse kinematics (IK) is insane and one of the many things you can do with it is procedural movment of your character. If you have problems with the code you can contact me in my discord server. (to make the legs move i used an open source module by ...
its p easy i believe
thankss
yo chat imma copy the movement system of this one its soooo sick
vector:Dot() solos this thread