FactorPhysics

์›”๋“œ ๊ฐ์ฒด์— ๋Œ€ํ•ด ๋ฌผ๋ฆฌ ๊ด€๋ จ ์„ค์ •์„ ์ฒ˜๋ฆฌํ•˜๋Š” ๊ฐ์ฒด์—์š”.

์†์„ฑ

Velocity

ํ˜„์žฌ ๋ฌผ๋ฆฌ ์†๋„์—์š”.

-- ์ƒ˜ํ”Œ --

print(Workspace.Cube.Physics.Velocity)

bOverrideMass

๋ถ€ํ”ผ๋กœ ์งˆ๋Ÿ‰์„ ์ž๋™ ๊ณ„์‚ฐํ•ด์š”.

-- ์ƒ˜ํ”Œ --

Workspace.Cube.Physics.bOverrideMass = true

Mass

์งˆ๋Ÿ‰ ๊ฐ’์ด์—์š”.

-- ์ƒ˜ํ”Œ --

Workspace.Cube.Physics.MassInKg = 5000

LinearDamping

์„ ํ˜• ๊ฐ์‡  ๊ฐ’์ด์—์š”.

-- ์ƒ˜ํ”Œ --

Workspace.Cube.Physics.LinearDamping = 0.1

AngularDamping

ํšŒ์ „ ๊ฐ์‡  ๊ฐ’์ด์—์š”.

-- ์ƒ˜ํ”Œ --

Workspace.Cube.Physics.AngularDamping = 0.1

Friction

๋งˆ์ฐฐ๋ ฅ ๊ฐ’์ด์—์š”. ์˜ค๋ธŒ์ ํŠธ์˜ ํ‘œ๋ฉด ๋ฌผ๋ฆฌ ๋งˆ์ฐฐ๋ ฅ์„ ์„ค์ •ํ•  ์ˆ˜ ์žˆ์–ด์š”. ์–ผ์ŒํŒ์—์„œ ๊ณต์ด ๋ฏธ๋„๋Ÿฌ์ง€๋Š” ์ •๋„๋ฅผ ์„ค์ •ํ•  ์ˆ˜ ์žˆ๋Š” ๊ฐ’์ด์—์š”(0 ~ 1์˜ ๋ฒ”์œ„). 0์— ๊ฐ€๊นŒ์šธ์ˆ˜๋ก ์ž˜ ๋ฏธ๋„๋Ÿฌ์ ธ์š”.

-- ์ƒ˜ํ”Œ --

Workspace.Cube.Physics.Friction = 0.1

Restitution

ํƒ„์„ฑ ๊ฐ’์ด์—์š”. ์˜ค๋ธŒ์ ํŠธ์˜ ํƒ„์„ฑ ๊ฐ’์„ ์„ค์ •ํ•  ์ˆ˜ ์žˆ์–ด์š”. ๊ณต์ด ํƒฑํƒฑ๋ณผ ์ฒ˜๋Ÿผ ๋ช‡๋ฒˆ ํŠ•๊ธฐ๋‹ค๊ฐ€ ๋ฉˆ์ถ”๋„๋ก ํ•˜๋Š” ์„ค์ •๊ฐ’์ด์—์š”(0 ~ 1์˜ ๋ฒ”์œ„). 1์— ๊ฐ€๊นŒ์šธ์ˆ˜๋ก ํƒ„์„ฑ์ด ๋” ์ปค์ ธ์š”.

-- ์ƒ˜ํ”Œ --

Workspace.Cube.Physics.Restitution = 0.1

Density

๋ฐ€๋„ ๊ฐ’์ด์—์š”. ์˜ค๋ธŒ์ ํŠธ์˜ ๋ฐ€๋„ ๊ฐ’์„ ์„ค์ •ํ•  ์ˆ˜ ์žˆ์–ด์š”(0 ~ 1์˜ ๋ฒ”์œ„). 1์— ๊ฐ€๊นŒ์šธ์ˆ˜๋ก ๋ฌผ์ฒด๊ฐ€ ๋” ๋‹จ๋‹จํ•ด์ง€๊ณ  ๋ฌด๊ฑฐ์›Œ์ ธ์š”.

-- ์ƒ˜ํ”Œ --

Workspace.Cube.Physics.Density = 0.1

ํ•จ์ˆ˜

void AddForce(Vector Force)

๊ฐ์ฒด์— ๋ฌผ๋ฆฌ ํž˜์„ ์ถ”๊ฐ€ํ•  ์ˆ˜ ์žˆ์–ด์š”. (ํž˜์„ ๊ฐ€ํ•  Vector ๊ฐ’)

-- ์ƒ˜ํ”Œ --

local toy = Script.Parent
local force = Vector.new(50000, 0, 0)

target.Physics:AddForce(force) --force๊ฐ’ ๋งŒํผ ์˜ค๋ธŒ์ ํŠธ๋ฅผ ๋ฐ€์–ด์š”. (์˜ค๋ธŒ์ ํŠธ์˜ ๋ฌผ๋ฆฌ ํ”„๋กœํผํ‹ฐ๊ฐ€ ์ผœ์ ธ์žˆ์–ด์•ผ ํ•ด์š”.)

void ZeroVelocity()

๊ฐ์ฒด์˜ ๋ฌผ๋ฆฌ ๋ฒกํ„ฐ๋ฅผ 0์œผ๋กœ ์ดˆ๊ธฐํ™”ํ•ด์š”.

-- ์ƒ˜ํ”Œ --

cube.Physics:ZeroVelocity()

Last updated