角色移動&勾爪

sleepyboy

目錄

Player movement

角色移動

return Physics2D.OverlapCircle(GroundCheck.position, 0.2f, GroundLayer);
# PRESENTING CODE

地面確認

  1. 建立一個隱形圓形區域
  2. 判斷區域內是否有碰撞箱
rb.linearVelocity = new Vector2(horizontal * speed, jumpingpower);
# PRESENTING CODE

velocity

rb.linearVelocity = new Vector2(horizontal * speed, rb.linearVelocityY);
  1. 對剛體施加外力 使其移動
  2. horizontal:根據按鍵判斷左右,什麼都不按是 0, 往左 -1, 往右 1

horizontal = Input.GetAxisRaw("Horizontal");

Grappling Gun

勾爪槍

# PRESENTING CODE

Line Renderer

# PRESENTING CODE

Distance Joint

Code

By April first

Code

  • 15