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)
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?
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
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?
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
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
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!
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
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?
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!
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?
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
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
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
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
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.
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?
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
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.
@@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
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.
@@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