์ด์ ์ฒด์ ๋๋ ์ฅ์น - Godot ๋ฒ์ :
Windows 10 x64 - Godot 2.1.2.stable.official
๋ฌธ์ ์ค๋ช
:
move()๋ฅผ ์ฌ์ฉํ์ฌ KinematicBody2D๋ฅผ ์ด๋ํ ํ Collider ๋ณํ์ด ์
๋ฐ์ดํธ๋์ง ์์ต๋๋ค.
๋ชจ๋ ์ด๋์ ์ด๊ธฐ Collider ์์น/๋ณํ์ผ๋ก๋ง ํ
์คํธ๋ฉ๋๋ค.
์ฌํ ๋จ๊ณ:
func _ready():
set_fixed_process(true)
func _fixed_process(delta):
move(Vector2(0, 100))
move(Vector2(100, 0))
set_fixed_process(false)
A๋ ์๋๋ก ์ด๋ํ์ง๋ง ์ค๋ฅธ์ชฝ์ผ๋ก๋ ์ด๋ํ์ง ์์ต๋๋ค.
์๋๋ก ์ด๋ํ ํ์๋ A๋ B ์๋์ ๋ง์ต๋๋ค.
B ์๋์ ์์ด์ผ ํ๊ณ L์ ๋ชจ์์ผ๋ก ์์ง์ฌ์ผ ํฉ๋๋ค(์ฒ์์๋ ์๋๋ก, ๋ค์์๋ ์ค๋ฅธ์ชฝ์ผ๋ก).
Move๋ Colliders๋ฅผ ์ ์์น๋ก ์
๋ฐ์ดํธํ์ง ์์ผ๋ฏ๋ก ์ค๋ฅธ์ชฝ์ผ๋ก ์ด๋ํ๋ ค๊ณ ํ๋ ๋์ ์ค๋ฅธ์ชฝ์ผ๋ก๋ง ์ด๋ํ๋ฉด B์ ์ํด ์ฐจ๋จ๋๋ ๊ฒ์ฒ๋ผ ๋ณด์
๋๋ค.
ํด๊ฒฐ ๋ฐฉ๋ฒ:
_fixed_process๋ฅผ ๋ค์์ผ๋ก ๋ณ๊ฒฝ:
func _fixed_process(delta):
move(Vector2(0, 100))
var st = get_shape_transform(0) # get current shape transform, assuming we only have 1 shape
st.o += get_travel() # add move translation to shape transform
set_shape_transform(0, st) # update shape transform
move(Vector2(100, 0))
# you should reset the shape transform to its original state befor returing
set_fixed_process(false)
์ด๊ฒ์ #7951๊ณผ ์ค๋ณต๋๋ค๊ณ ์๊ฐํ์ง๋ง @RandomShaper ๊ฐ ํ์ธํ๋๋ก ํ๊ณ ์ถ์ต๋๋ค.
์, ๊ฐ์ ๋ฌธ์ ์ ๋๋ค.
๋๋ ๊ทธ๊ฒ์ ๋์ณค๋ค.
๊ฐ์ฌ ํด์.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
์ด๊ฒ์ #7951๊ณผ ์ค๋ณต๋๋ค๊ณ ์๊ฐํ์ง๋ง @RandomShaper ๊ฐ ํ์ธํ๋๋ก ํ๊ณ ์ถ์ต๋๋ค.