RaycastResult
Overview
RaycastResult๋ ๋ ์ด์บ์คํธ๊ฐ ์ค์ ๋ก ์ด๋ค ๋์๊ณผ ์ถฉ๋ํ๋์ง์ ๋ํ ๊ฒฐ๊ณผ ์ ๋ณด๋ฅผ ๋ด๋ ๋ฐ์ดํฐ ํ์ ์ ๋๋ค. WorldRoot:Raycast ํธ์ถ์ด ์ฑ๊ณตํ์ ๋ ๋ฐํ๋๋ฉฐ, ์ถฉ๋ ์ง์ , ์ถฉ๋ํ ๊ฐ์ฒด, ํ๋ฉด ์ ๋ณด ๋ฑ ๋ ์ด์บ์คํธ ๊ฒฐ๊ณผ ๋ถ์์ ํ์ํ ๋ค์ํ ๋ฐ์ดํฐ๋ฅผ ์ ๊ณตํฉ๋๋ค.
Constructors
Properties
Distance
number
Raycast๊ฐ ์์๋ ์์น๋ก๋ถํฐ ์ถฉ๋์ด ๋ฐ์ํ ์ง์ ๊น์ง์ ์ง์ ๊ฑฐ๋ฆฌ๋ฅผ ๋ํ๋ ๋๋ค.
Code Samples
local Workspace = game:GetService("Workspace")
local Origin = Vector3.new(0, 50, -0)
local Direction = Vector3.new(0, 0, -3000)
local Result = Workspace:Raycast(Origin, Direction)
if Result then
print("Hit distance:", Result.Distance)
endInstance
Instance
Raycast๊ฐ ์ถฉ๋ํ ๋์ ๊ฐ์ฒด๋ฅผ ์๋ฏธํฉ๋๋ค.
Code Samples
Position
Vector3
Raycast๊ฐ ๋์๊ณผ ์ถฉ๋ํ ์์น๋ฅผ ์๋ ๊ณต๊ฐ ๊ธฐ์ค์ ์ขํ๋ก ๋ํ๋ ๋๋ค.
Code Samples
Normal
Vector3
Raycast๊ฐ ์ถฉ๋ํ ํ๋ฉด์ด ๋ฐ๋ผ๋ณด๊ณ ์๋ ๋ฐฉํฅ์ ๋ํ๋ด๋ ๋ฒกํฐ์ ๋๋ค. ์ถฉ๋ ์ง์ ์ ๋ฉด์ ์์ง์ธ ๋ฐฉํฅ์ ๊ธฐ์ค์ผ๋ก ํ๋ฉฐ, ๋ฐ์ฌ ์ฒ๋ฆฌ, ๊ฐ๋ ๊ณ์ฐ, ํ๋ฉด ๋ฐฉํฅ ํ์ ๊ณผ ๊ฐ์ ํ์ ์ฐ์ฐ์ ํ์ฉ๋ฉ๋๋ค.
Code Samples
Methods
See also
WorldRootLast updated