VectorForce

VectorForce : Constraint

Overview

๊ฐ์ฒด์— ์ง€์†์ ์ธ ํž˜๊ณผ ๊ฐ€์†๋„๋ฅผ ์ฃผ๊ธฐ ์œ„ํ•œ ๋ฌผ๋ฆฌ ์ œ์•ฝ(Constraint) ์ธ์Šคํ„ด์Šค์ž…๋‹ˆ๋‹ค.

์ด ์ œ์•ฝ์€ ๊ฐ€์†์ด ๊ณ„์† ๋ˆ„์ ๋˜๊ธฐ ๋•Œ๋ฌธ์—, ๋‹ค๋ฅธ ํž˜์ด ์—†์œผ๋ฉด ์—„์ฒญ ๋น ๋ฅด๊ฒŒ ์›€์ง์ผ ์ˆ˜ ์žˆ์œผ๋ฏ€๋กœ, ์†๋„๋ฅผ ์ผ์ •ํ•˜๊ฒŒ ์œ ์ง€ํ•˜๊ณ  ์‹ถ๋‹ค๋ฉด LinearVelocity ์ œ์•ฝ์„ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์ด ์œ ๋ฆฌํ•ฉ๋‹ˆ๋‹ค.

RelativeTo ์†์„ฑ์„ World ๋˜๋Š” Attachment ์ค‘ ์–ด๋””๋กœ ์„ค์ •ํ•˜๋А๋ƒ์— ๋”ฐ๋ผ, ํž˜์ด ์ ์šฉ๋˜๋Š” ๊ธฐ์ค€์ด ๋‹ฌ๋ผ์ง‘๋‹ˆ๋‹ค.

Properties

Force

Vector3

ํž˜์˜ ํฌ๊ธฐ์™€ ๋ฐฉํ–ฅ์„ ์„ค์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Code Samples

local Part = script.Parent
local Attachment = Part.Attachment

local VectorForce = Instance.new("VectorForce")
VectorForce.Attachment0 = Attachment
VectorForce.RelativeTo = Enum.ActuatorRelativeTo.World 
VectorForce.Force = Vector3.new(500000, 0, 0) 
VectorForce.Parent = Part

RelativeTo

Enum.ActuatorRelativeTo

ํž˜์ด ์ ์šฉ๋˜๋Š” ๊ธฐ์ค€ ์ขŒํ‘œ๊ณ„๋ฅผ ์„ค์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Code Samples

local VectorForce = script.Parent

VectorForce.RelativeTo = Enum.ActuatorRelativeTo.World

ApplyAtCenterOfMass

bool

ํž˜์ด ์–ด๋””์— ์ž‘์šฉํ• ์ง€๋ฅผ ์„ค์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ด ์†์„ฑ์„ ๋น„ํ™œ์„ฑํ™”ํ•˜๋ฉด ํž˜์€ ๋ฌผ์ฒด์˜ ์ค‘์‹ฌ(์งˆ๋Ÿ‰ ์ค‘์‹ฌ)์— ์ ์šฉ๋ฉ๋‹ˆ๋‹ค. ๋ฐ˜๋Œ€๋กœ ํ™œ์„ฑํ™”ํ•˜๋ฉด ํž˜์€ Attachment0์ด ์žˆ๋Š” ์œ„์น˜์— ๊ฐ€ํ•ด์ง€๋ฉฐ, ์ด ์œ„์น˜๊ฐ€ ์ค‘์‹ฌ์ด ์•„๋‹Œ ๊ฒฝ์šฐ ํšŒ์ „์ด ํ•จ๊ป˜ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Code Samples

Methods

Events

See also

๋ฌผ๋ฆฌ

Last updated