I want to find out how I can make a “missile” or a part smoothly track another part, even if the target part is moving? Kinda like ICBMS ig
Can you please be more specific? I have no idea on what you are trying to achieve. Can you also give us some examples and what attempts you have tried?
They want a missile that follow to another part. So if that part moves, the missile also moves as well. Not sure what you don’t understand.
yeah, exactly what you said. Do you know how I could do this?
Do you have a Missile already?
no, but I can make one / grab a free model for testing
here is a reference: SAM Missile Launcher - Roblox Virtual Products - YouTube ← Ik thats really advanced and hard but I just wanna know how I would make it track kinda like that where it doesnt just fly around like a fireball or something, but anything would be appreciated
My first idea is to use CFrame
, both for positioning and rotating the missile to the target concerned.
I saw a few videos kinda like that but making it go smoothly would cause a performance spike right? especially if there are multiple instances
I don’t think repeatedly setting a new CFrame
for the model will cause a performance spike. But you can attest this in studio.
and if I were to do that, how would I make the actual tracking part is my main question. Sorry if im being stupid ;( I dont use CFrame or velocity stuff
He literally wants to create a tracking sustem
Again, CFrame
is the only thing I can think of right now. Or maybe other physics constraints which you can take a look of it here.
I know. My answer may not be clear but if you read and understand how CFrame
works, then my answer could work. How about you share us your idea here?
Im not saying you should create one (that’d be nice tho), im asking how would I make one…
So, one of the steps is having a “lookat” cframe, so from the base of the Missile position and then the Part Position. You’d need to have it on a loop or detect if the part has changed position.
I’m not a professional scripter so I’m not really sure how, sorry maybe you could look for how real rockets work and recreate that in studio? Here’s how they do
Also do you want the system to be 100% accurate or have a error margin? If it’s the second I would create a part that is at the coordinates of the HumaniidRootPart that is way bigger than the player and make the missile go in any place of the part
So, I did a small script. Is this how you would want it? Though It’s best to not use tweens as the speed increases if the Target is Far.
that looks great, it could use a bit of tinkering but thats very nice, can I have it?