#how does roblox's mathematics work?
1 messages · Page 1 of 1 (latest)
how so?
** You are now Level 10! **
idk l was reading luau get started and they use math but why cant you just put in the right number
wdym
its math
A fast, small, safe, gradually typed embeddable scripting language derived from Lua
u'll see
if i think to know what u are meaning, these a placeholders.
whats a place holder
just like in normal math bro
Number1 = 1
Number2 = 2
print(Number1 + Number2) ---> prints 3 bc Number1 is set to 1 and Number2 is set to 2
1 + 2
** You are now Level 1! **
1+1=2
?
variables???
why are you calling them placeholders
💔
its the same logic
its just so werid
i dont see
what im saying is like why do u need to do 1 + 1 why can't u do print("2")
you dont have to
its just math
print("2")
thats what im saying whats the point
its used in some systems
for example
adding to leaderstats
bro it was just an example of math
and you use math to calculate velocity
it was an example
whats so hard to understand
yea thats true yea thats true and also for camera view why do people use math
it depends, if math is needed its used
depends on what ur doing
go learn more
you dont have a clear understanding yet
leaderstats.Cash.Value += 1
this is an example
just adding 1
what are you confused about mr samwich
i know that but people mostly use it for camera views and pov's why do they do math
they dont mostly use it for that
like i said
go learn more
you dont have a clear understanding
its just like any other programming language
1+1=2
1-1=0
1*1=1
1/1=1
math
you could make a part follow a player at an offset with math
local playerPositon = --player posion thingys
local part = Instance.new("part")
part.Parent = workspace
local offset = Vector3.new(0, 10, 0)
part.Postion = playerPostion + offset
you would need to put it in a loop
but thats a simple way of using math to do smt
@potent wagon look youre right but in coding placeholders are one of the most important thing. i mean u can print just 2 but coding is basically just math in words.
u need to use placeholder/variables for good games
U need to use Cframe so the part follows the player not vector3
no you dont
its just following the player
rotation doesnt matter
ty
🤦
no problem!
bro you dont
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local rootPart = character:WaitForChild("HumanoidRootPart")
local part = Instance.new("Part")
part.Size = Vector3.new(2, 2, 2)
part.Anchored = true
part.CanCollide = false
part.BrickColor = BrickColor.new("Bright red")
part.Parent = workspace
local offset = Vector3.new(0, 10, 0)
RunService.Heartbeat:Connect(function()
local playerPosition = rootPart.Position
part.Position = playerPosition + offset
end)
run the code
bro i know that it works but it looks like shit
you literally said it wouldnt work unless it was a cframe
i meant that almost no one uses Vector3 for things like that. Sorry if i didnt wrote it right
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local rootPart = character:WaitForChild("HumanoidRootPart")
local part = Instance.new("Part")
part.Size = Vector3.new(2, 2, 2)
part.Anchored = true
part.CanCollide = false
part.BrickColor = BrickColor.new("Bright red")
part.Parent = workspace
local offset = CFrame.new(0, 10, 0)
RunService.Heartbeat:Connect(function()
local playerPosition = rootPart.CFrame
part.CFrame = playerPosition * offset
end)
The code looks identical if i use cframes
yes people do