How to make an AI LASER TURRET in Roblox Studio #1 - Turret Setup and Kinematics

  Рет қаралды 12,276

B Ricey

B Ricey

Күн бұрын

Пікірлер: 63
@np51486
@np51486 Жыл бұрын
Very sick video, thanks for uploading. The way the turret moves reminds me of how Yaskawa and Fanuc robotic arms operate when doing a bunch of cartesian plane movements, definitely gonna be a sick addition for my turret animations!
@candycorn-t8h
@candycorn-t8h 9 ай бұрын
this guy the best he legit just gave us model dont even need to control c and v
@BRicey
@BRicey 9 ай бұрын
Hey actually watch the video don’t just take it…. (I mean no one’s stopping you butttt)
@rashy15
@rashy15 Жыл бұрын
truly a roblox studio master class 😭
@navy_2467
@navy_2467 Жыл бұрын
You should try making some soldier ai. Taking cover, suppression fire, etc would be interesting to see. I know yellowmustang has already made one but it would cool to see how it was fully made and the science behind it.
@MichaelObamaSon
@MichaelObamaSon Жыл бұрын
thank you for all your videos. you are an amazing teacher.
@BRicey
@BRicey Жыл бұрын
You're very welcome!
@MatteoP04ita
@MatteoP04ita Жыл бұрын
I think I will watch all the videos about Cframes you cited. Being able to operate with CFrames lets you create anything
@BRicey
@BRicey Жыл бұрын
Indeed… and it also transfers to other game engines and other applications too
@AgentRobloxDeveloper
@AgentRobloxDeveloper Жыл бұрын
very cool i like it
@robnoob6820
@robnoob6820 Жыл бұрын
this is sick
@KindaSalty
@KindaSalty Жыл бұрын
I Really Needed This, Thanks! 👍
@itsdakideli755
@itsdakideli755 Жыл бұрын
These tutorials are amazing!
@BRicey
@BRicey Жыл бұрын
Glad you like them!
@thejr9944
@thejr9944 Жыл бұрын
As someone else has previously mentioned, how do you know how to use methods :Cross() and :Angle()? Aside from that, this video is a great follow up video to finding angles between two vectors 👍
@BRicey
@BRicey Жыл бұрын
I have a video going over angle, check the description... cross is just weird it still kind of feels like black magic to me, but in short it imagines two vectors making up their own plane, and returns a vector perpendicular to the plane with the magnitude corresponding to something about the vectors... just getting the perpendicular unit vector is all I've ever used it for
@plshelpmewithtds
@plshelpmewithtds Жыл бұрын
I really want the submarine game to come out! please upload videos on it.
@Unknown-ym3ds
@Unknown-ym3ds Жыл бұрын
That's certified cool 😎
@MatteoP04ita
@MatteoP04ita Жыл бұрын
Great! I voted for another video tutorial (player controlled mortar) but this one will still be useful
@dev_snips
@dev_snips Жыл бұрын
Been a developer for nearly a decade and i still do not understand a thing about anything related to Roblox's physics. I've attempted to follow this well made guide, and i got as far as attaching the hinges. Except that my hinges don't drop with gravity. And afterwards, the small boat that i had set up basically just decided it'd fling itself for absolutely no reason, that being with or without the little turret. Got to admit that Roblox has the most unfriendly physics engine I've seen. I quite literally do not understand what the hell is causing all these problems. It's a shame though, since I was planning on expanding these turrets over to other moving objects. Back to CFrame i go, at least CFrame is reliable.
@hongngo3491
@hongngo3491 Жыл бұрын
Hey man, loving your tank turret vids! I've been working on my own tank project and tried using your method for getting the turret to follow the mouse. At first I was stoked cause it worked perfectly in your demo - the turret would smoothly rotate to match the mouse angle. But when I plugged it into my tank, it didn't work right. No matter where I moved the mouse, the script only showed the starting angle of the turret, not the actual rotated angle. Any ideas what could be tripping me up? A quick update video explaining common issues would be super helpful. Or if you have time to send over some example code or tips, I'd really appreciate you taking a look under the hood! Keep up the awesome tutorials - they're saving me a ton of time debugging this tank lol. Let me know if you can help!
@HanzTheGamer
@HanzTheGamer Жыл бұрын
I got 2 questions - Can you make it target NPCs instead of players? -Can you customize the turret without breaking it?
@AzizBeess
@AzizBeess Жыл бұрын
I would use RayCast if not your video! Thx for the tutorial. I dunno get those math things
@rashy15
@rashy15 Жыл бұрын
if you could show a visual representation of how the angle and cross stuff works
@ttpechon2535
@ttpechon2535 Жыл бұрын
How do you find out which functions and that to use? Like how do figure out which things you will use and what methods, as I have no idea where you would even start. When I read through the defiintions of the functions I draw a blank on what they do, PointToObjectSpace sounds like it would point to and object, and then you read the definition and suddenly it seems to be something else. Is it just experience and hearing about these things and knowing how they work because you used something similar, or is it common sense? I'm guessing you know how to do this with math, and then you're finding the api equivalents to accomplish this right? Anyway thanks for making these, you really explain what your doing and it really helps, they're way to many people who make vids say do this then that and it shows you how to do it, but not very well and you don't understand it.
@BRicey
@BRicey Жыл бұрын
Great question! I recommend just browsing through the documentation on the Roblox Creator Hub and seeing what might be useful; Roblox has some of the best docs around! And no, I don't know how to do this with math. I'm in the process of learning these things, but I've only taken up to a calculus course, and almost all of the math I use in Roblox (and 3d games in general) is linear algebra. For me, its just guess and check until it becomes intuition. Just play around with the functions, use videos like these to add tools to your toolbox... learning is just a process!
@ttpechon2535
@ttpechon2535 Жыл бұрын
@@BRicey Excellent, thanks! I'll have to look into Linear Algebra and that to.
@np51486
@np51486 Жыл бұрын
How performance intensive do you think this turret would be? Im thinking of rendering them locally on the client with about 15-30 instances of them being active at a time
@BRicey
@BRicey Жыл бұрын
I mean it’s running every frame but it’s only doing basic calculations so it shouldn’t be bad. The enemy detection is the worst perf impact, but you can avoid that by putting it on a timer
@np51486
@np51486 Жыл бұрын
@@BRicey Sounds great! I dont plan on using any player detection, the turrets are to be centrally controlled and targeted by the player and hit detection will be a formula based on distance of turret from the target
@ItsLeeeroy
@ItsLeeeroy Жыл бұрын
This would be useful in a defense type tycoon
@lothomost2231
@lothomost2231 Жыл бұрын
Will you cover how to make it not target certain players like the owner of the turret?
@P.R.C.E-official83
@P.R.C.E-official83 7 ай бұрын
When I run the simulation, the target part keeps disappearing
@RandomPerson-lu8ln
@RandomPerson-lu8ln Жыл бұрын
This will genuinely help out a lot, thank you Question, does this work on moving things like cars? Note: seeing a fellow person wanting to make a tank as well, I wanted to know how you could actually fix these problems?
@BRicey
@BRicey Жыл бұрын
Theoretically it should work on tanks and cars, but I guess it doesn't. I kinda want to make a tank one day so I guess you could wait for that; but I would encourage you to try and play with it yourself.
@RandomPerson-lu8ln
@RandomPerson-lu8ln Жыл бұрын
@@BRicey thanks for the recommendation! My friend and i will take note on this.
@penguinpenguin3156
@penguinpenguin3156 Жыл бұрын
Hey Im on episode three of your tycoon series can you tell me how to fix ServerScriptService.Tycoon:74: attempt to index nil with 'Event'
@zetta6656
@zetta6656 Жыл бұрын
What if my turret is a naval turret and I want the housing to rotate but the barrels to go up and down?
@romanchaidiouk2788
@romanchaidiouk2788 Жыл бұрын
dude there is no way... I saw your previous video from 6 months ago a couple days ago and really wanted to know how to make this work with 2 hinges cause my Y axis hinge was bugging out and I was struggling to find a way to fix it. I was literally ganna try to leave a comment on your most recent video asking for the turret video but your most recent video was the video I wanted. this video was made for me 😭😭😭
@romanchaidiouk2788
@romanchaidiouk2788 Жыл бұрын
am I the main character? are you living in my walls watching my every move? GET OUT OF MY HEAD
@BRicey
@BRicey Жыл бұрын
I'm always watching 👀
@faronb651
@faronb651 Жыл бұрын
nice video
@Xackory
@Xackory Жыл бұрын
Smart kid. Subbed
@lmao4383
@lmao4383 Жыл бұрын
I would love this turret to have a whitelisted player list so it doesnt shoot everyone.
@voxeledphoton
@voxeledphoton Жыл бұрын
I made a quick module that lets you get the nearest character given a table of characters. Has a function that would let you specify a player table too (just remember the vector findNearest returns will need to be added to the position of the turret for getting the direction variable) local module = {} local Players = game:GetService("Players") function module.addPlrCharacters(charTbl:{}?,plrWhitelist:{}?) local chars = charTbl or {} local plrs = plrWhitelist or Players:GetPlayers() for _,plr in plrs do if plr.Character then table.insert(chars,plr.Character) end end return chars end function module.findNearest(pos:Vector3,chars:{}?,maxDist:number?) local charTbl = chars or module.addPlrCharacters() local nv = nil local nd = maxDist or 1000 for _,char in charTbl do local hrp = char:FindFirstChild("HumanoidRootPart") if hrp then local dirVect = hrp.Position-pos if dirVect.Magnitude
@barnacolium6947
@barnacolium6947 5 ай бұрын
idk if im right in thinking this but could you have the base not anchored but welded to smth else like a moving car and it still work fine? im imagining that it does due to the direction variable being recalculated every frame
@barnacolium6947
@barnacolium6947 5 ай бұрын
nvm doesnt work lol, i think with the ref object also needing to be anchored is wat breaks it
@meowyhearts3030
@meowyhearts3030 Жыл бұрын
Hi ,, could you make a tutorial where if a player is not looking at a certain object a part moves , and when that part moves a text label will pop up? just asking because I’m experimenting with stuff :]]
@Chris_Hansen123
@Chris_Hansen123 Жыл бұрын
still waiting for the next devlog
@yumiyumee
@yumiyumee Жыл бұрын
hey Ricey, your videos are really cool lol. Can you help me out with something? I have a gibbing system on my game, it gets gibs based on the ray position of a gun, but the formula I'm using to get these gibs doesn't work well. Do you have any other formulas that I could use? I made a topic in DevForum but no one replied.
@simonixen
@simonixen Жыл бұрын
can u make a model of the turret? i just want to use this for learning and i dont bother making a model
@BRicey
@BRicey Жыл бұрын
so so sorry I completely forgot to add these to the description... double check and make sure the template link I pasted works. Thanks!
@simonixen
@simonixen Жыл бұрын
@@BRicey Thanks! 😄
@scribble1135
@scribble1135 Жыл бұрын
How long have you been coding on roblox for?
@LuckyTheRabbit6
@LuckyTheRabbit6 Жыл бұрын
I unachord the turret and didn’t work
@TheLordTenebris
@TheLordTenebris 3 ай бұрын
8:39
@LuckyTheRabbit6
@LuckyTheRabbit6 Жыл бұрын
Btw can I be your friend on roblox btw if you ask me that I have discord I don’t have one sadly
@SmallDonated
@SmallDonated Жыл бұрын
gun
@julierhodes1956
@julierhodes1956 Жыл бұрын
🌹 Promo>SM
@duckdude765
@duckdude765 Жыл бұрын
pov: you were looking for the script
@refusalstudios
@refusalstudios Жыл бұрын
still not ai
@ttpechon2535
@ttpechon2535 Жыл бұрын
@SortaIrish XD
Pro Scripter vs Roblox AI... (Should you be Worried?)
16:01
RoBuilder
Рет қаралды 87 М.
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 31 МЛН
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН
How To EASILY Make Procedural Animations In Roblox
6:46
Roox4
Рет қаралды 128 М.
🚨WARNING🚨 NEW ROBLOX SCAM...
14:38
KreekCraft
Рет қаралды 479 М.
10 Minutes vs. 10 Years of Animation
19:29
Isto Inc.
Рет қаралды 1,5 МЛН
Making a ROBLOX game with its new AI
6:28
DeHapy
Рет қаралды 887 М.
A new way to generate worlds (stitched WFC)
10:51
Watt
Рет қаралды 557 М.
THIS VIDEO IS BANNED IN THE UNITED STATES
9:27
corny
Рет қаралды 91 М.
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 31 МЛН