The Most ACCURATE Projectile in ROBLOX!!
yes i clickbait but the vid is REAL
learn abt physics and kinematics
Resources:
FastCast - etithespir.it/FastCastAPIDocs/
Physics by Professor Dave - • Classical Physics
Discord: / discord
My current project: / discord
Пікірлер: 106
Part 2 is out now!!! Learn how to make your projectiles bounce!! kzread.info/dash/bejne/qqdqqZSEmNPPgJc.htmlsi=ju6EgeyIsvYbWpXu
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
Fantastic video, exactly what I needed and you actually managed to explain it pretty well
you're talented oml❤
Thanks for the tutorial, so helpful :D
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
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
7 күн бұрын
Hope it comes out well!
This is gonna be so good for my fighting game knockback, thanks
Thank you very much, I learned a lot from this video.
this is so incredibly underrated
you resumed my physics semester
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.
Thought I was learning physics. Anyways, nice video
thx for the video
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.
I was looking for client-side hitbox as it fixes network latency issues but nice tutorial.
@notactuality
10 ай бұрын
clientcast?
@kokobroxd
10 ай бұрын
you can just use it on client side
the memory usage went up to 3 gigabytes lol
Idk why but this is the coolest video on roblox studio I have ever seen
Very nice!
very cool vid
thanks, I hate relying on other peoples modules
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?
The issue with having hitboxes client side is that a user can exploit them to hit every time. I prefer having them on the server for that reason, also because everyone gets the same performance that way, one persons hitbox accuracy is the same as anothers.
@Reviire
2 ай бұрын
Yeah. The client can tell the server where to start it, but all validation should be on the server only. As long as simulation is consistent between client and server the client predicted simulation should be almost the same as the server, if ping is high there may be issues though. But it'll still feel good to use as long as it's predicted on the client rather than appearing 0.2-0.4s in the past on your client.
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.
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
only reason i subbed is to fix the 666 nice video btw
Can i use this to make a cannon like bofors or flak 88 ?
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
4 ай бұрын
This video was made before spherecast was added. Use spherecast problem solved
@Xisco72
4 ай бұрын
tysm you were right!!! congrats on the video, really useful module to move big projectiles 🥰 @@fidgetspinner71
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
11 ай бұрын
CFrame.LookAt()
@qxxrd
11 ай бұрын
@@pepperdayjackpac4521 Can you please elaborate more?
@pepperdayjackpac4521
11 ай бұрын
@@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
11 ай бұрын
@@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
11 ай бұрын
@@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)
Wait. If it’s running on the client doesn’t that make it not secure?
So i have an error that says that projectile is not a member of folder modules, whats the fix?
@VeryProPlayerYesSir1122
11 ай бұрын
you need a folder for the projectiles you are shooting at.
It seems like roblox projectiles has this weird delay for every shot. It makes it look weird.
wow cool
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
8 ай бұрын
Could you be more specific? Maybe you could even open a devforum post about it
@cyberlordshop
7 ай бұрын
Yeah absoloutely. Fire the event, whenever you want the firework to be activated. Just name the start, dest and force. It should work.
@reddeadleisure
6 ай бұрын
Bruh i think i replied to the wrong comment
@cyberlordshop
6 ай бұрын
really?@@reddeadleisure
A trick, instead of using Heartbeat and wait() in your script, use task.wait(). The task.wait() command can run at the same speed as heartbeat (60hz, every frame), but you can also input seconds into the parenthesis the same as normal wait().
@beedrillking4023
18 күн бұрын
just use render stepped much better
how do i make it so when it touches a part it destroys and doesnt just go through it
@fidgetspinner71
5 ай бұрын
End the loop whenever the raycast detects something
is it possible for me to do this without a tool?
@fidgetspinner71
Жыл бұрын
yes, thats why I made it into a module.
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
9 ай бұрын
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
9 ай бұрын
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
9 ай бұрын
if you wanna do stuff with runservice I'd put checks with like ticks() to make sure your code acts as desired
@haxking2
9 ай бұрын
@@thetable8175 wouldn't delta time have the same effect though? or am I misunderstanding it
@thetable8175
9 ай бұрын
@@haxking2 yeah delta time is the absolute difference between 2 times
What is "self"? ( self.Wind.X, self.Wi...)
Great vid
hello jit.
ko-
Its better to have a black list raycast param instead of whitelist for bigger games
@pepperdayjackpac4521
11 ай бұрын
Why
@WoozyNate
10 ай бұрын
@@pepperdayjackpac4521 you will have to constantly add many folders and children instead of just blacklisting certain things
@rei2261
10 ай бұрын
@@pepperdayjackpac4521 because unless u wanted to whitelist couple of things it would be more efficient
@notactuality
10 ай бұрын
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
7 ай бұрын
@pepperdayjackpac4521 it'll reach a point where there's less things you want it to hit instead of ignore
How do I make it so that I can apply these physics to an already existing part?
@vlogsquad7113
3 ай бұрын
programming
@phyopyaelynn-wp6fc
2 ай бұрын
Unanchor it
@cupcakewithrabies-eb4rq
2 ай бұрын
@@vlogsquad7113 i figured out thanks
hi wuzrd
Yo so the projectile curves for me without adding wind Any ideas why?
@illogicalsavings8268
Күн бұрын
That's the gravity
wcb
projectile doesnt shoot and i did everything correctly what do i do
@Kylerisano
10 ай бұрын
That's a you problem 🤠 🙌
@namebutworse
10 ай бұрын
@@Kylerisano :( (BWOOOMP) ;(
@illogicalsavings8268
Күн бұрын
Ever fix it?
man but i hate math!
8yt
das
`
I hate math 🤠🤠🤠🤠🤠🤠🤠🤠🤠🤠🤠🤠🤠🤠
Awesome😃
for some reason this line has an error for me - newProjectile.Params.FilterType = Enum.RaycastFilterType.Whitelist
@NotTaskAgain
6 ай бұрын
Change it to "Enum.RaycastFilterType.Include" at the end, I think thats the issue
@_Sench
4 ай бұрын
Just incase you still need it. For some reason its underlined but it works in game my line- newProjectile.Params.FilterType = Enum.RaycastFilterType.Whitelist
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
11 ай бұрын
Since ray result is nil, your visualization will not follow anything since it does not exist so do Part.Position = projPos
@rei2261
10 ай бұрын
@@MythIsTheLegend that doesn't work
@MythIsTheLegend
10 ай бұрын
@@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
10 ай бұрын
@@MythIsTheLegend ok
@R3DACTED3310
7 ай бұрын
why does the projectile spawn higher then the player
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
10 ай бұрын
do u have the name in correctly