The Most ACCURATE Projectile in ROBLOX!!

  Рет қаралды 50,123

fidgetspinner71

fidgetspinner71

Күн бұрын

Пікірлер: 130
@fidgetspinner71
@fidgetspinner71 Жыл бұрын
Part 2 is out now!!! Learn how to make your projectiles bounce!! kzbin.info/www/bejne/rqSZeGWBndWchpYsi=ju6EgeyIsvYbWpXu
@Rocush
@Rocush Жыл бұрын
THE WAY I CLAPPED AND SAID YESSS! 💀 WHEN YOU SAID I'M GONNA TEACH YOU HOW TO WRITE IT YOURSELF. So many dang tutorials are just people showing us how to use the modules and I've always hated those videos because I want to know how to do it not just rely on someone else and never learn. I was about to click off and then you said "the module FastCast" I'm so happy this wasn't one of those.
@gggamingtakeshi7035
@gggamingtakeshi7035 11 ай бұрын
Here I am, with my non mathematician brain making a goal part created on mouse position with a limited range, then moving it downwards and slowly accelerates downwards faster simulating gravity and having my raycast slowly approach it based on bullet speed when I could've just done this.
@faded_ace5144
@faded_ace5144 Жыл бұрын
This is definitely complex but what's more complex are the emotions you feel whilst trying to deal with body velocities and watching something move in the air at a total speed of 5fps. So ty
@whozproxy
@whozproxy 11 ай бұрын
Thanks for this video! I’m pretty new with Raycasts and I’m trying to make a custom gun system or my game and this will help a lot!
@williamhutchins479
@williamhutchins479 7 ай бұрын
Hope it comes out well!
@hccybercraft5076
@hccybercraft5076 6 ай бұрын
Bro's better at teaching physics more than the teachers i know.
@thebestn0oobever
@thebestn0oobever Жыл бұрын
This is gonna be so good for my fighting game knockback, thanks
@theprancingprussian
@theprancingprussian 11 ай бұрын
very useful, im testing ideas on developing a matchlock gun system, a single tool instead of getting over my head with an entire game, helps great since the accurate physics of it performs way further from hitscan than other weaponry
@vis7040
@vis7040 11 ай бұрын
you resumed my physics semester
@Vortex-qb2se
@Vortex-qb2se Жыл бұрын
I was looking for client-side hitbox as it fixes network latency issues but nice tutorial.
@notactuality
@notactuality Жыл бұрын
clientcast?
@kokobroxd
@kokobroxd Жыл бұрын
you can just use it on client side
@TREB0RZ
@TREB0RZ 7 ай бұрын
@@notactuality bad for projectiles
@yaspat616
@yaspat616 Жыл бұрын
you're talented oml❤
@masterssandwich3312
@masterssandwich3312 Жыл бұрын
the memory usage went up to 3 gigabytes lol
@cezito6831
@cezito6831 4 ай бұрын
because the video code isn't doing OOP, for every new projectile it creates all the same methods again
@imthebestmayne122
@imthebestmayne122 4 ай бұрын
@@cezito6831 I noticed that too, and I was unsure if I was the one who was mistaken, but I guess not.
@NotAltered7750
@NotAltered7750 Жыл бұрын
Thought I was learning physics. Anyways, nice video
@r4nd0mStuff
@r4nd0mStuff 6 ай бұрын
Well I learned that a lot easier than I thought I would. You're a pretty good teacher 👍👍
@vrfrenzy8451
@vrfrenzy8451 Жыл бұрын
thanks, I hate relying on other peoples modules
@bittertea562
@bittertea562 8 күн бұрын
The modules are very simple but hard to use. I agree
@Dark-z5g
@Dark-z5g 3 ай бұрын
Man i learned about projectile motion and their equation few weeks ago in physics book
@FunkyTrucky
@FunkyTrucky 8 ай бұрын
Thank you very much, I learned a lot from this video.
@grevict
@grevict Жыл бұрын
Thanks for the tutorial, so helpful :D
@KodaBunn
@KodaBunn Жыл бұрын
this is so incredibly underrated
@Xisco72
@Xisco72 11 ай бұрын
I don't think this is the best for big projectiles, because i'm using this to move a trash MeshPart, and sometimes it goes through parts that shouldn't because they can collide. For example, i'm throwing this meshpart against a house wall, it collides with it and detects the hit, but it trespasses it. Maybe because the mesh is kinda "big" and since you are constantly changing the position, it goes through them unlike when you are using a velocity mover
@fidgetspinner71
@fidgetspinner71 11 ай бұрын
This video was made before spherecast was added. Use spherecast problem solved
@Xisco72
@Xisco72 11 ай бұрын
tysm you were right!!! congrats on the video, really useful module to move big projectiles 🥰 @@fidgetspinner71
@qxxrd
@qxxrd Жыл бұрын
hey, I'm working on a throwable football and I want the nose of the football to be looking at the direction that the player throws in. I have my own custom caster which handles the football drop and physics.
@pepperdayjackpac4521
@pepperdayjackpac4521 Жыл бұрын
CFrame.LookAt()
@qxxrd
@qxxrd Жыл бұрын
@@pepperdayjackpac4521 Can you please elaborate more?
@pepperdayjackpac4521
@pepperdayjackpac4521 Жыл бұрын
@@qxxrd CFrame.LookAt will angle your obj so that it faces its targetPosition. It takes in two parameters: the starting position (the position of the obj) and the targetPosition (which is where the obj will be facing towards), both are Vector3. if your football is changing directions, then you need to recalculate the starting and target position each time so that the nose points like it would in real life. But if it's just moving in a straight line, then you won't need to recalculate.
@qxxrd
@qxxrd Жыл бұрын
@@pepperdayjackpac4521 I have tried to do what you said but the problem now is the when the player throws to the side the nose of the football is fowards and not facing where the player aimed to. Caster Code: NewProjectile = self.Projectile:Clone() DirectionVector = (target - origin).Unit PositionVector = *Trajectory Calculations* -- THIS PART IS IN A LOOP NewProjectile.CFrame = CFrame.lookAt(ProjectilePosition, DirectionVector)
@fidgetspinner71
@fidgetspinner71 Жыл бұрын
@@qxxrd just multiply it by some rotation cframe that fits with your model (ex. CFrame.Angles(math.rad(90),0,0) ) (i think cframe.angles uses radians instead of degrees but idk just play around with it)
@sarwix8306
@sarwix8306 Жыл бұрын
Idk why but this is the coolest video on roblox studio I have ever seen
@Jelleydev
@Jelleydev Жыл бұрын
only reason i subbed is to fix the 666 nice video btw
@happe3513
@happe3513 Жыл бұрын
I haven't seen anyone else with this problem in the comments but every time I require the module it says attempt to call a table value.
@LeapInno
@LeapInno Жыл бұрын
It seems like roblox projectiles has this weird delay for every shot. It makes it look weird.
@SeraphicTranquility
@SeraphicTranquility Жыл бұрын
Its better to have a black list raycast param instead of whitelist for bigger games
@pepperdayjackpac4521
@pepperdayjackpac4521 Жыл бұрын
Why
@WoozyNate
@WoozyNate Жыл бұрын
@@pepperdayjackpac4521 you will have to constantly add many folders and children instead of just blacklisting certain things
@rei2261
@rei2261 Жыл бұрын
@@pepperdayjackpac4521 because unless u wanted to whitelist couple of things it would be more efficient
@notactuality
@notactuality Жыл бұрын
you cant allocate for every single thing the projectiles should hit a metaphor would be rather sort out the bad ones instead of look for the good ones @@pepperdayjackpac4521
@Nightwinger5100
@Nightwinger5100 Жыл бұрын
​@pepperdayjackpac4521 it'll reach a point where there's less things you want it to hit instead of ignore
@SurrealTurnip
@SurrealTurnip Жыл бұрын
Fantastic video, exactly what I needed and you actually managed to explain it pretty well
@Its_Just_Cy
@Its_Just_Cy 3 ай бұрын
This works but theres one problem for me, When i make a bullet model (Or any rectangular model) move with the module, it doesnt point on the thin side, it positions on the wider side, And idk how to fix it at this rate Edit: I also want it to point towards where its moving,
@Saiki13
@Saiki13 3 ай бұрын
Try rotating it by 90 degrees in the code, also if you right click the part and click "Show Orientation Indicator" it's going to show you where the front side is
@Its_Just_Cy
@Its_Just_Cy 3 ай бұрын
@@Saiki13 Ty i kinda already figured EVERYTHING out, to kinda fix this its a roblox model issue, i just made the object a model with the primary part the right way
@Its_Just_Cy
@Its_Just_Cy 3 ай бұрын
@@Saiki13 Also i was gonna say how to make it face the velocity of where its moving (So that it curves yknow) and i figured it out, just before the line where you make currentpos into projpos put this in. local direction = (projPos - currentpos).Unit
@Saiki13
@Saiki13 3 ай бұрын
@@Its_Just_Cy Good thing you figured it out, Also thx, i was wondering how to do that lol
@Al3xWarrior
@Al3xWarrior Жыл бұрын
Very nice!
@Test_749
@Test_749 2 ай бұрын
imma use this for knockback
@Test_749
@Test_749 2 ай бұрын
i made knockback with it THANKS
@Ey_SmoKrac
@Ey_SmoKrac 7 ай бұрын
not watchin allat it 3:14 in da damn mornin i tired asshit
@felipemfrudeli
@felipemfrudeli Жыл бұрын
thx for the video
@TinShredder
@TinShredder Жыл бұрын
very cool vid
@A_TerriblePerson
@A_TerriblePerson 3 ай бұрын
Very nice tutorial, although I am having an issue with the whitelist showing up with an error "Unable to cast value to Objects"
@Glimmers
@Glimmers Жыл бұрын
Hey awesome video! When I put in a model as projectile it moves just fine but it looks a little bit choppy because I am just settings its position every RayCast do you think Tween or Lerping would work in anyway for the projectile so it looks smove when it moves?
@YeaIAmPyaeSone
@YeaIAmPyaeSone 22 күн бұрын
It Can Work On Fast?
@bob-rx9yb
@bob-rx9yb 11 ай бұрын
Can i use this to make a cannon like bofors or flak 88 ?
@multistronomy
@multistronomy 4 ай бұрын
hey idk if ur still active but i have a problem where once i cast it in the onserverevent it gives me an error on the line where we set the rayResult, "Unable to cast Vector3 to raycast params" not sure if this is outdated tho (this might be bc i replaced "whitelist" in the params with "include" since thats deprecated)
@C_G.
@C_G. 3 ай бұрын
Hi ! I have a weird question , is this entire project possible without the module script like any alternative method for module script part bcz of some reasons.
@trilazer_duo8659
@trilazer_duo8659 Жыл бұрын
So i have an error that says that projectile is not a member of folder modules, whats the fix?
@VeryProPlayerYesSir1122
@VeryProPlayerYesSir1122 Жыл бұрын
you need a folder for the projectiles you are shooting at.
@citizenfoffie7605
@citizenfoffie7605 Жыл бұрын
Would there be a way for me to set it to hit a certain amount of studs by adding on angle(but without moving the mouse up), to create a zeroing effect
@Gray_mk
@Gray_mk Жыл бұрын
how do i make it so when it touches a part it destroys and doesnt just go through it
@fidgetspinner71
@fidgetspinner71 Жыл бұрын
End the loop whenever the raycast detects something
@Sadjhj
@Sadjhj Жыл бұрын
Hey, is it possible to use this on a model? I have a firework game and I want to move the firework physics to client side but every time I tried I couldn’t get it to work.
@reddeadleisure
@reddeadleisure Жыл бұрын
Could you be more specific? Maybe you could even open a devforum post about it
@cyberlordshop
@cyberlordshop Жыл бұрын
Yeah absoloutely. Fire the event, whenever you want the firework to be activated. Just name the start, dest and force. It should work.
@reddeadleisure
@reddeadleisure Жыл бұрын
Bruh i think i replied to the wrong comment
@cyberlordshop
@cyberlordshop Жыл бұрын
really?@@reddeadleisure
@haxking2
@haxking2 Жыл бұрын
great video, idk why but I've always been under the impression that this would've been more complex. quick question though, does using runservice to execute code every frame on client (even if it's just changing a few values) not a good practice?
@Antonio-vf2xj
@Antonio-vf2xj Жыл бұрын
Well i didnt see the video fully but yea, if ya uses renderstepped, but as its used on clientside i guess, it doesnt affect server at all, so maybe slighty lag but no server lag so like data saving and everything else is safe
@thetable8175
@thetable8175 Жыл бұрын
as far as I know you need to take into account people having different frame rates causing codes to run too fast or too slow, I've seen many games put for example dashes that update a BodyVelocity's direction every frame for a set amount of times and then destroy it causing higher fps to destroy the BodyVelocity earlier making you travel shorter while capping your fps at around 30 would make it go a lot further
@thetable8175
@thetable8175 Жыл бұрын
if you wanna do stuff with runservice I'd put checks with like ticks() to make sure your code acts as desired
@haxking2
@haxking2 Жыл бұрын
@@thetable8175 wouldn't delta time have the same effect though? or am I misunderstanding it
@thetable8175
@thetable8175 Жыл бұрын
@@haxking2 yeah delta time is the absolute difference between 2 times
@hotcrazy15
@hotcrazy15 Жыл бұрын
wow cool
@cupcakewithrabies-eb4rq
@cupcakewithrabies-eb4rq 10 ай бұрын
How do I make it so that I can apply these physics to an already existing part?
@vlogsquad7113
@vlogsquad7113 10 ай бұрын
programming
@phyopyaelynn-wp6fc
@phyopyaelynn-wp6fc 9 ай бұрын
Unanchor it
@cupcakewithrabies-eb4rq
@cupcakewithrabies-eb4rq 9 ай бұрын
@@vlogsquad7113 i figured out thanks
@user-nil_cyan
@user-nil_cyan 10 ай бұрын
What is "self"? ( self.Wind.X, self.Wi...)
@AnonymousWatcherAmigo
@AnonymousWatcherAmigo 8 күн бұрын
OOP search it up in youtube
@Master_A-A
@Master_A-A 10 ай бұрын
Yo so the projectile curves for me without adding wind Any ideas why?
@illogicalsavings8268
@illogicalsavings8268 7 ай бұрын
That's the gravity
@rielzedrielzed
@rielzedrielzed 5 ай бұрын
@@illogicalsavings8268 💀
@chiaweijie194
@chiaweijie194 Жыл бұрын
is it possible for me to do this without a tool?
@fidgetspinner71
@fidgetspinner71 Жыл бұрын
yes, thats why I made it into a module.
@namebutworse
@namebutworse Жыл бұрын
projectile doesnt shoot and i did everything correctly what do i do
@Kylerisano
@Kylerisano Жыл бұрын
That's a you problem 🤠 🙌
@namebutworse
@namebutworse Жыл бұрын
@@Kylerisano :( (BWOOOMP) ;(
@illogicalsavings8268
@illogicalsavings8268 7 ай бұрын
Ever fix it?
@sadge6430
@sadge6430 11 ай бұрын
ko-
@samdoesnotexist79
@samdoesnotexist79 Жыл бұрын
hello jit.
@hadderzi
@hadderzi Жыл бұрын
hi wuzrd
@l8tralalt901
@l8tralalt901 Жыл бұрын
man but i hate math!
@aqaisback9517
@aqaisback9517 6 ай бұрын
;-;
@sadge6430
@sadge6430 9 ай бұрын
wcb
@GoofySlugpup
@GoofySlugpup 5 ай бұрын
1:40 i do not care
@stopmotionadventures4812
@stopmotionadventures4812 Ай бұрын
1 hour ago
@spriteman1925
@spriteman1925 Жыл бұрын
I hate math 🤠🤠🤠🤠🤠🤠🤠🤠🤠🤠🤠🤠🤠🤠
@sadge6430
@sadge6430 11 ай бұрын
`
@sadge6430
@sadge6430 9 ай бұрын
8yt
@sadge6430
@sadge6430 11 ай бұрын
das
@Xackory
@Xackory Жыл бұрын
Great vid
@Mufazl
@Mufazl Жыл бұрын
Awesome😃
@CrystalizedGGG
@CrystalizedGGG Жыл бұрын
for some reason this line has an error for me - newProjectile.Params.FilterType = Enum.RaycastFilterType.Whitelist
@NotTaskAgain
@NotTaskAgain Жыл бұрын
Change it to "Enum.RaycastFilterType.Include" at the end, I think thats the issue
@_Sench
@_Sench 11 ай бұрын
Just incase you still need it. For some reason its underlined but it works in game my line- newProjectile.Params.FilterType = Enum.RaycastFilterType.Whitelist
@VeryProPlayerYesSir1122
@VeryProPlayerYesSir1122 Жыл бұрын
local Projectile = require(Modules.Projectile).new(1,workspace:GetChildren(),Vector3.new(0,0,0),3, true) 15:08:41.240 Projectile is not a valid member of Folder "ServerScriptService.Modules" - Server - slingshot_server:9 please help me, the code gives this kind of error
@chanceplayz-roblox230
@chanceplayz-roblox230 Жыл бұрын
do u have the name in correctly
@VeryProPlayerYesSir1122
@VeryProPlayerYesSir1122 Жыл бұрын
local RunService = game:GetService("RunService") local Debris = game:GetService("Debris") local Projectile = {} function Projectile.new(Gravity, Whitelist, Wind, DespawnTime, Visualize) local newProjectile = {} newProjectile.Gravity = Gravity newProjectile.Wind = Wind newProjectile.DespawnTime = DespawnTime newProjectile.Visualize = Visualize newProjectile.Params = RaycastParams.new() newProjectile.Params.FilterType = Enum.RaycastFilterType.Whitelist newProjectile.Params.FilterDescendantsInstances = Whitelist function newProjectile:Cast(start, dest, force) local conversion = (game.Workspace.Gravity) / 9.8 local vForce = (dest - start).Unit * force * conversion local a = Vector3.new(self.Wind.X, self.Wind.Y - self.Gravity * 9.8, self.Wind.Z) * conversion local t = 0 local currentPos = start local rayResult = nil local found = false local Connection = RunService.Heartbeat:Connect(function(dt) if not found then t = t + dt local projPos = Vector3.new( start.X + vForce.X * t + 0.5 * a.X * t * t, start.Y + vForce.Y * t + 0.5 * a.Y * t * t, start.Z + vForce.Z * t + 0.5 * a.Z * t * t ) rayResult = workspace:Raycast(currentPos, projPos - currentPos, self.Params) currentPos = projPos if self.Visualize then local Part = Instance.new("Part") Part.Size = Vector3.new(0.5, 0.5, 0.5) Part.Position = rayResult.Position Part.Anchored = true Part.CanCollide = false Part.Material = Enum.Material.Neon Part.Color = Color3.fromRGB(0, 255, 0) Part.Shape = "Ball" Part.Parent = game.Workspace Debris:AddItem(Part, 0.5) end if rayResult or t > self.DespawnTime then found = true end end end) while not found do wait() end Connection:Disconnect() if rayResult then print("Detected") end end return newProjectile end return Projectile Did i do anything wrong because the "rayResult = workspace:Raycast(currentPos, projPos - currentPos, self.Params)" is nil and "Part.Position = rayResult.Position" returns an error.
@MythIsTheLegend
@MythIsTheLegend Жыл бұрын
Since ray result is nil, your visualization will not follow anything since it does not exist so do Part.Position = projPos
@rei2261
@rei2261 Жыл бұрын
@@MythIsTheLegend that doesn't work
@MythIsTheLegend
@MythIsTheLegend Жыл бұрын
@@rei2261 It should work because if you do everything correctly and then set part pos to the projectile pos then it always follows the position of the part because if your raycast is nil it don't exist meaning your visual just doesn't go anywhere else.
@rei2261
@rei2261 Жыл бұрын
@@MythIsTheLegend ok
@R3DACTED3310
@R3DACTED3310 Жыл бұрын
why does the projectile spawn higher then the player
The Most ACCURATE BOUNCING Projectiles in ROBLOX!!!
15:06
fidgetspinner71
Рет қаралды 4,9 М.
Why do Roblox hitboxes suck?
6:38
CHECK COMMUNITY TAB
Рет қаралды 238 М.
“Don’t stop the chances.”
00:44
ISSEI / いっせい
Рет қаралды 62 МЛН
Каха и дочка
00:28
К-Media
Рет қаралды 3,4 МЛН
Can you make a VR game in Scratch? (devlog #1)
10:00
STEM MC
Рет қаралды 156 М.
Can I 100% Superliminal and Get a Refund?
23:36
Gronf
Рет қаралды 401 М.
I try different ways of Animating for ROBLOX
13:46
jackiepwners
Рет қаралды 57 М.
I Made a Roblox Game in 100 Hours...
11:26
reyn
Рет қаралды 372 М.
The Issue of Poorly Designed Roblox Abilities
15:18
ByteBlox
Рет қаралды 11 М.
What Roblox Doesn't Tell You | Roblox Studio
9:38
Stewiepfing
Рет қаралды 34 М.
Magnitude Hitboxes | How It Works | Roblox Studio
3:51
Tekleed
Рет қаралды 14 М.
Roblox Devs, stop misusing :WaitForChild()!
17:13
Crusherfire
Рет қаралды 81 М.