Тёмный

Roblox Studio HOW TO MAKE A PART MOVE IN A SPIRAL AND CIRCLE | Sin Cos Rad Tutorial. 

Joel__
Подписаться 940
Просмотров 28 тыс.
50% 1

Опубликовано:

 

23 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 134   
@nateking6629
@nateking6629 3 года назад
INCREDIBLY helpful, I've never understood how circles are made in roblox studio and I stumbled upon this and now I actually somewhat know how to do it myself. Thanks B)
@joel__1104
@joel__1104 3 года назад
So glad I was able to help you understand :)
@nateking6629
@nateking6629 3 года назад
@@joel__1104 same, keep up the good vids 👍
@spencerprovenzola6174
@spencerprovenzola6174 2 года назад
I really hope you see this, I am having an issue using any scripts and i'm new to it. If I follow it exactly, it doesnt work, so I adapt it because im trying to make a model move in the circle rather than a part, and it still does not work, is there any way you can help me?
@bertleviathan
@bertleviathan 6 месяцев назад
@@spencerprovenzola6174 make a handle and then put the script inside it
@manuedz
@manuedz Год назад
this helped me a lot. specially using math with world pivots
@jay.7923
@jay.7923 2 года назад
Bro ily, I just watched your bezier curve video.
@gameloft136
@gameloft136 Год назад
Thanks for this video! It's help me so much!
@NVX-MUSIC
@NVX-MUSIC Год назад
local part = script.Parent local runservice = game:GetService("RunService") local degree = 0 while runservice.Heartbeat:Wait() do degree += 2 local x = 10 * math.cos(math.rad(degree)) local y = 10 * math.sin(math.rad(degree)) local z = degree/10 part.Position = Vector3.new(x,y,z) end
@kaiissocoolngl
@kaiissocoolngl Год назад
thx
@kakaduu9570
@kakaduu9570 2 года назад
Hello!, Great tutorial I really liked it, I know Im late but ill be happy if u would help me solve my problem, I copied your script as showed in the video and it goes to the middle of the map and I need to stay in the same spot as it was before testing do you know the solution?
@FederalNando
@FederalNando 2 года назад
You can also use beizer curves (tutorial in the api reference)
@BasilLikesScripting
@BasilLikesScripting 10 месяцев назад
a lot less efficient tho
@stephsmoon
@stephsmoon 2 года назад
Thanks for the great video! Is there a way to speed the motion?
@stephsmoon
@stephsmoon 2 года назад
@SyrumFlows Thank you so much!
@lynxica2133
@lynxica2133 2 года назад
If you understand the very basics of trigonometry you would be able to work this out.
@gutzputz
@gutzputz Год назад
@@stephsmoon the faster it is, the more square it will look like
@commensalism1997
@commensalism1997 2 года назад
oh, i know this from making bullet hells. i wonder what happens in 3D if you swap cos and sin
@charizardthelizard8236
@charizardthelizard8236 Год назад
From what I remember, it stays the same considering cos and sin work very similarly. Correct me if I’m wrong tho cuz I’m a little new to trigonometry
@voloMan092
@voloMan092 Год назад
thanks for the tutorial!
@vein6801
@vein6801 2 года назад
this is very helpful
@Misterhelpfulman123
@Misterhelpfulman123 7 месяцев назад
I gave the 970th like on the video! i was very satisfying 🤣
@Ibloop
@Ibloop Год назад
I haven’t taken trigonometry yet but I still understand your script
@squishedbonana4609
@squishedbonana4609 Год назад
how do I stop it? I use end, doesn't stop, I use break and it stops working completely, I don't think I can use disconnect either because it is heartbeat:Wait(), but I'm not sure because I don't use heartbeat often so if you could get back to me that would be appreciated
@HalalDev
@HalalDev 3 года назад
Let’s go another vid
@GavenHistory
@GavenHistory Год назад
How would you make the part's orientation match on the circle?
@rudhav20playz
@rudhav20playz Год назад
script.Parent.Orientation = Vector3.new(0, math.deg(degree) + 90, 0)
@turtleDev32
@turtleDev32 2 года назад
Thanks man
@brotachikun149
@brotachikun149 5 месяцев назад
Can you explain the cos and sin? I want a simple explain so I can understand more.
@gtrhrhtth
@gtrhrhtth Год назад
OMG THANK YOU SO MUCH I DIDN'T REALISE I WROTE THE SCRIPT WRONG SORRY MU EYES MISS LINES LOL TYSM THIS WILL HELP ME WITH MY GAME AND JUMPS I WANTED TO MAKE AGES AGO
@yuramekh4422
@yuramekh4422 Год назад
whats the moving part for? i cant even find how its code is made anywhere
@megnar8192
@megnar8192 2 года назад
hey how to make it move half of the circle then stop?
@Fr0stKnight0k
@Fr0stKnight0k Год назад
Does z use tangent, sine, or cosine?
@glitch7126
@glitch7126 Год назад
I keep getting an error of allo something location and it dosn't work
@Ketheramvs
@Ketheramvs 3 года назад
I like a lot
@xxtavatxxtaxxxxat8452
@xxtavatxxtaxxxxat8452 2 года назад
how can i attach the part in a specific position without teleport?
@aooide
@aooide Год назад
Good video brother
@Lime-eq4xg
@Lime-eq4xg Год назад
i copyed the script and all of it but when i press "RUN" its just a part that stands still
@PotatoKingo
@PotatoKingo Год назад
Bro is explaining trigonometry better than the professors
@ddashdev6943
@ddashdev6943 2 года назад
I have a question, why did you use while runService.Heartbeat:Wait() instead of just using runService.Heartbeat:Connect()?
@ddashdev6943
@ddashdev6943 2 года назад
Really helpful video btw, keep up with great content:)
@joel__1104
@joel__1104 2 года назад
Heartbeat:Connect() is like a while loop running on the servers heartbeat. But heartbeat:Wait() you can use in for loops etc. it’s situational, and is typically up to you. Whatever gets the job done well!
@tofu7403
@tofu7403 2 года назад
Great tutorial helped me understand cos and sin after months... can u give me the download for that chart
@Carlang29
@Carlang29 10 месяцев назад
it works but i cant get the trail to work
@53XM4CH1N3
@53XM4CH1N3 Год назад
can this be done in a way it falls like a normal block once it stops spinning?
@agermanshepherd1238
@agermanshepherd1238 3 месяца назад
probably, try using this after the script. wait(desired time) (variable or partname).Anchored = false
@enricoaraujomonteiro
@enricoaraujomonteiro 2 месяца назад
local part = script.parent local RunService = game:getservice("RunService") local degree = 0 while RunService.heartbeat:wait() do degree += 1 local x = math.cos(math.rad(degree)) local y = math.sin(math.rad(degree)) local z = 1 part.position = Vector3.new(x,y,z) end
@noahrepublic
@noahrepublic 2 года назад
Say I was to use this in UI would this be offset or scale positions
@joel__1104
@joel__1104 2 года назад
It really depends on your goal, you rarely want to use offest because that won't scale for all device sizes, so I'd generally say scale is easier!
@AverageGamer-jp9hi
@AverageGamer-jp9hi 8 месяцев назад
hey dude can you makee it so we can copy and paste
@BerryGerbo
@BerryGerbo Год назад
how to part follow player?
@ahhhhh9318
@ahhhhh9318 3 года назад
Can you teach about bezier curiving?
@joel__1104
@joel__1104 3 года назад
I will plan on making a future tutorial on bezier curves.
@HalalDev
@HalalDev 3 года назад
@@joel__1104 i would love that because that’s what I’m trying to learn rn
@Bikoil
@Bikoil 10 месяцев назад
i know it has been 2 years, but could you tell me how to make it work with models?
@YourLocalKarura
@YourLocalKarura 9 месяцев назад
I'd suggest just unioning the models main part to the spiral brick
@Bikoil
@Bikoil 9 месяцев назад
@@YourLocalKarura okay I'm gonna try that
@E.sMusic668
@E.sMusic668 3 года назад
This same concept is used to make walking animations for FPS viewmodels on a basic level 👀
@joel__1104
@joel__1104 3 года назад
Circles are useful, what can I say.
@spencerprovenzola6174
@spencerprovenzola6174 2 года назад
I really hope you see this, I am having an issue using any scripts and i'm new to it. If I follow it exactly, it doesnt work, so I adapt it because im trying to make a model move in the circle rather than a part, and it still does not work, is there any way you can help me?
@Petit_loup137
@Petit_loup137 Год назад
for me the part turn arround 0,0 like doing a perfect scircle arround that cordonate
@charlieotoole5757
@charlieotoole5757 3 года назад
I saw radians on the thumbnail and I was like why
@joel__1104
@joel__1104 3 года назад
You see radians, you immediately think trigonometry lol.
@charlieotoole5757
@charlieotoole5757 3 года назад
@@joel__1104 innit 😭 🙏
@sevenade
@sevenade 2 года назад
Is there a way to make the circle spin on a different axis?
@joel__1104
@joel__1104 2 года назад
The circle moves in the direction I specify it to go, so all you would need to do is change some numbers and play around with it and you could definitely get it to spin along a different axis. Notice how I have Z as a constant value, that means that x and y values are spinning along the z axis. So you could definitely make y the constant value, or perhaps x. It's totally up to you!
@sevenade
@sevenade 2 года назад
@@joel__1104 ah, thank you. This cleared it up somewhat.
@sevenade
@sevenade 2 года назад
Idk why I said somewhat, this cleared it up fully.
@spencerprovenzola6174
@spencerprovenzola6174 2 года назад
I really hope you see this, I am having an issue using any scripts and i'm new to it. If I follow it exactly, it doesnt work, so I adapt it because im trying to make a model move in the circle rather than a part, and it still does not work, is there any way you can help me?
@scriptshowcase5111
@scriptshowcase5111 2 года назад
how to make this is going to up?
@TaseenA09
@TaseenA09 2 года назад
sick
@ymym8292
@ymym8292 2 года назад
great vid ! but is there a way to make it not jump to the middle of the baseplate, like can i put it anywhere in the map without it jumping to the same x y z values
@amalgat-lol
@amalgat-lol 2 года назад
Instead of actually defining X as he did by looking at property use variable for ex. char.HumanoidRootPart.Position.X (or something like that) Edit: nvm idk how to do that :D
@majastevanov
@majastevanov Год назад
Sleigher
@RealTurwin
@RealTurwin Год назад
I've tried making it but it wont go in a circle Script: local part = script.Parent local runService = game:GetService("RunService") local degree = 0 while runService.Heartbeat:Wait() do degree += 1 local x = 10 * math.cos(math.rad(degree)) local y = 10 * math.cos(math.rad(degree)) + 11 local z = 1 part.Position = Vector3.new(x, y, z) end
@_Prismic
@_Prismic Год назад
Hello! Not sure if this is too late but according to the script above where you have put "math.cos" & "math.cos" is the problem. Here is a rewrite for the correct code... Script: local part = script.Parent local runService = game:GetService("RunService") local degree = 0 while runService.Heartbeat:Wait() do degree += 1 local x = 10 * math.cos(math.rad(degree)) local y = 10 * math.sin(math.rad(degree)) + 11 local z = 1 part.Position = Vector3.new(x, y, z) end
@zzisavage
@zzisavage 2 года назад
I like math
@juanangelgaelgastelum-nava366
@juanangelgaelgastelum-nava366 11 месяцев назад
how do i make it so it doesnt just snap to 0, 0, 0? edit: nvm, i just did a new value that didnt change that was my part position
@RoCkO555
@RoCkO555 8 месяцев назад
how
@nickgraham6720
@nickgraham6720 2 года назад
how do i make it not teleport to middle
@sudeeshnair7759
@sudeeshnair7759 2 года назад
Hey thanks for the tutorial but how can I make it revolve like a halo above your head?
@ozzy503
@ozzy503 2 года назад
make it positioned 0,5,0 from ur HRP
@fitmotheyap
@fitmotheyap 11 месяцев назад
Very late but you can just do the same but position it above the players head and do it for the x and z axis instead of x and y
@joakimgizmo4646
@joakimgizmo4646 2 года назад
How would I do if I wanted it to move to X position when I press Z Button.
@joel__1104
@joel__1104 2 года назад
create a button, then you can use an event such as MouseButton1Down. Connect that to a function that fires an event to the server which the server will change the position of the Instance.
@Teenaged.guy1541
@Teenaged.guy1541 6 месяцев назад
can u send the code it wont work
@spencerprovenzola6174
@spencerprovenzola6174 2 года назад
I really hope you see this, I am having an issue using any scripts and i'm new to it. If I follow it exactly, it doesnt work, so I adapt it because im trying to make a model move in the circle rather than a part, and it still does not work, is there any way you can help me?
@Sadjhj
@Sadjhj 2 года назад
Have you figured it out yet?
@wheresmybraincells
@wheresmybraincells 9 месяцев назад
i literally cannot do this despite looking at every single detail, its annoying
@YourLocalKarura
@YourLocalKarura 9 месяцев назад
Try moving the primary part of the model
@Evelyn_the1
@Evelyn_the1 Год назад
tryy that local part = script.parent local RunService = game:GetService("RunService") local degree = 0 local scale = 14 -- Adjust the scaling factor as desired while RunService.Heartbeat:Wait() do degree = degree + 1 local x = scale * (20 + math.cos(math.rad(degree))) local y = scale * (20 + math.sin(math.rad(degree))) + (22 * scale) local z = 1 part.Position = Vector3.new(x, y, z) end
@HyperixBR
@HyperixBR Год назад
how do i make it faster
@tritium2733
@tritium2733 Год назад
welp, I’m not getting it to go in circles the only thing that is happening is that it is creating a sine wave
@tritium2733
@tritium2733 Год назад
nvm, I fixed it
@Mateesapa
@Mateesapa Год назад
trail dosent show up and making the trail isnt shown in the video
@YourLocalKarura
@YourLocalKarura 9 месяцев назад
It is 10:19
@RoCkO555
@RoCkO555 8 месяцев назад
how to make it not teleport, can someone give me the script for it
@Manvadakk
@Manvadakk Год назад
it doesnt work can someone give me the script down pls!👇
@GalaxyofArt
@GalaxyofArt 2 года назад
How can I make it so that it orbits around a part? And how do I stop it from going to the origin of the game?
@guilhermoferreira7275
@guilhermoferreira7275 Год назад
this dint work at all,can you make an uptaded tutorial?
@joel__1104
@joel__1104 Год назад
Although this video is 1 year old, I can guarantee you the script in this video still works :). If Roblox would deprecate features entirely, it would reap havoc on games. And also you're probably gonna wanna make sure you have the basics down on Roblox studio before hopping into an Intermediate / Advanced tutorial. You will want to make sure the part is Anchored, Collisions are off on it, and of course you're using a Server Script and not local. These little details are often a deal breaker when following a tutorial.
@guilhermoferreira7275
@guilhermoferreira7275 Год назад
@@joel__1104 i did everything correctly but still it doesnt move,collisions are off and its anchored and script its server script.
@squishedbonana4609
@squishedbonana4609 Год назад
worked for me so idk
@youareanidiot8980
@youareanidiot8980 Год назад
for me the circle is slow and small
@taterloltot
@taterloltot 9 месяцев назад
just please tell me how to test your game wihtout pressing play and just stay editing
@Mikeythegamer
@Mikeythegamer 9 месяцев назад
u cant
@taterloltot
@taterloltot 9 месяцев назад
@@Mikeythegamer how the hell did this guy do it
@Mikeythegamer
@Mikeythegamer 9 месяцев назад
@@taterloltot maybe because they dont need to press play to see it or it’s just editing
@YourLocalKarura
@YourLocalKarura 9 месяцев назад
He is actually testing, there is a button that let's you toggle if your in the flying mode or not
@gigachad6148
@gigachad6148 2 года назад
hmmm tusk act 4 spin
@EncounterRBLX
@EncounterRBLX Год назад
for me it doesnt work. i just copied all the scripts you made and i run it but it doesnt work, still :(
@Mee270
@Mee270 Год назад
Are you getting any errors?
@EncounterRBLX
@EncounterRBLX Год назад
@@Mee270 nah, i copied all of what he type
@EncounterRBLX
@EncounterRBLX Год назад
@@Mee270 the part aint just doing a circle and aint moving
@Mee270
@Mee270 Год назад
@@EncounterRBLX that's weird, can you send ur code here? Also sine and cosine return a value between -1 and 1 so don't froget to multiply the result to make a bigger circle
@grannaa
@grannaa Год назад
make sure collision is off and anchor is on
@jay.7923
@jay.7923 2 года назад
Water wheel 💧
@glitch7126
@glitch7126 Год назад
So I can't even do it
@LiamLafortune
@LiamLafortune 5 месяцев назад
it no work
@othek5557
@othek5557 Год назад
Didn't work
@Tiller08
@Tiller08 Год назад
this didnt work
@kikimunson
@kikimunson Год назад
i wanted free code
@1atatime1
@1atatime1 Год назад
BRUH
@MadeRayzz
@MadeRayzz 2 года назад
Like loading :l
@chrisrey0018
@chrisrey0018 2 года назад
Doesn't work anymore, ofc roblox always has to change stuff and ruin scripts
@joel__1104
@joel__1104 2 года назад
Don’t worry about it, it’s essentially a script that does computations and changes the position of a part! Should still work!
@TroubledManFR
@TroubledManFR 6 месяцев назад
too much mathematics
@tylerpink3096
@tylerpink3096 2 года назад
Thanks, I used this code to make a bosses attack, how would i do something like change circles completion time to be faster/slower? for any interested heres the attack code lol; local mistPosX = enemyTorso.Position.X local mistPosY = enemyTorso.Position.Y + enemyMagicStats.summon.yOffset local mistPosZ = enemyTorso.Position.Z local mist = magicParts.Mist:Clone() mist.Position = Vector3.new(mistPosX, mistPosY, mistPosZ) mist.Material = "Neon" mist.Color = enemyTorso.Color mist.Parent = workspace debris:AddItem(mist, enemyMagicStats.summon.lifetime) local degree = 0 local summonBuildup = 0 local balls = {} repeat wait() degree += enemyMagicStats.summon.degree summonBuildup += 1 mist.Position = Vector3.new(enemyMagicStats.summon.diameter * math.cos(math.rad(degree)) + mistPosX, mistPosY, enemyMagicStats.summon.diameter * math.sin(math.rad(degree)) + mistPosZ) if summonBuildup >= enemyMagicStats.summon.buildup then summonBuildup = 0 local ball = magicParts.Ball:Clone() ball.Position = mist.Position ball.Material = "Neon" ball.Color = enemyTorso.Color ball.Anchored = true ball.Parent = workspace debris:AddItem(ball, enemyMagicStats.summon.lifetime) table.insert(balls, ball) end until degree >= 360 if target ~= nil then enemy:SetPrimaryPartCFrame(CFrame.lookAt(enemy.PrimaryPart.Position, Vector3.new(target.Position.X, enemy.PrimaryPart.Position.Y, target.Position.Z))) end attackDirectionX = enemyHead.CFrame.lookVector.X attackDirectionZ = enemyHead.CFrame.lookVector.Z for _, ball in pairs (balls) do ball.Anchored = false local bodyVel = Instance.new("BodyVelocity", ball) bodyVel.MaxForce = Vector3.new(math.huge, math.huge, math.huge) bodyVel.Velocity = Vector3.new(attackDirectionX + (math.random(-20, 20) / 100), -0.5, attackDirectionZ + (math.random(-20, 20) / 100)) * enemyMagicStats.summon.speed table.insert(magicAttacks, ball) end end
@panamora5127
@panamora5127 2 года назад
I doubt you still need help with this, but if anyone else is having this issue to speed up the spinning speed of the part, look at 12:03 Basically the higher the degree increment, the faster the circle will spin. For example in your code, your degree increases by the value of "enemyMagicStats.summon.degree" so you would change the value of that.
@tylerpink3096
@tylerpink3096 2 года назад
@@panamora5127 Thanks! appreciate it, but yeah I figured it out like 2 minutes after posting that.. probably should've taken it down but appreciate the reply
@shahed11022
@shahed11022 Год назад
how do i flip it to spiral upwards
Далее
Roblox Studio Intro to Bezier Curves w/ Visuals!
21:28
СДЕЛАЛИ СОБСТВЕННЫЙ МУЛЬТИК
25:15
ТЕСЛА КИБЕРТРАК x WYLSACOM / РАЗГОН
1:40:47
The Basics of Perlin Noise | Roblox Studio Tutorial
27:05
Roblox sine and cosine explination
11:25
Просмотров 4,8 тыс.
How I Became a Sea of Thieves Developer
8:05
Просмотров 266 тыс.
10 Minutes vs. 10 Years of Animation
19:29
Просмотров 1,1 млн
The Most Impressive Scratch Projects
11:00
Просмотров 4,9 млн
I Made Roblox SATISFYING...
9:28
Просмотров 1,4 млн
СДЕЛАЛИ СОБСТВЕННЫЙ МУЛЬТИК
25:15