Unity3d 人物的跳躍
果然谷歌就是無敵, 不過都是定位到unity的community裡的
void Update(){
// Jump
if (Input.GetButtonDown("Jump"))
{
if (grounded == true)
{
float h = Input.GetAxis("Horizontal"); // A D
float v = Input.GetAxis("Vertical"); // W S
//Debug.Log(h + " " + v);
if (Input.GetKey("w"))
{
playerRigidbody.velocity = transform.forward * (v * speed);
}
if (Input.GetKey("s"))
{
playerRigidbody.velocity = transform.forward * (v * speed);
}
if (Input.GetKey("a"))
{
playerRigidbody.velocity = transform.right * (h * speed);
}
if (Input.GetKey("d"))
{
playerRigidbody.velocity = transform.right * (h * speed);
}
playerRigidbody.AddForce(new Vector3(0f, jumpForce, 0f));
grounded = false;
}
}
}
相關文章
- 跳躍遊戲遊戲
- redis 跳躍表Redis
- 貪心——55. 跳躍遊戲 && 45.跳躍遊戲II遊戲
- [Leetcode]44.跳躍遊戲Ⅰ&&45.跳躍遊戲ⅡLeetCode遊戲
- 玩家角色——角色跳躍
- 跳躍遊戲精細化遊戲
- 試著跳一下?講講遊戲中的“跳躍”遊戲
- 微信小遊戲之跳一跳-電腦自動跳躍遊戲
- Unity3D裡場景跳轉Unity3D
- 走近原始碼:Redis跳躍列表究竟怎麼跳原始碼Redis
- (演算法)跳躍問題演算法
- 跳躍式索引(Skip Scan Index)的淺析索引Index
- 資料結構(一)--- 跳躍表資料結構
- Redis資料結構—跳躍表Redis資料結構
- 順序跳躍顯示陣列中的值陣列
- Mysql索引的使用-組合索引+跳躍條件MySql索引
- 線上求助,有沒有大佬能講解一波redis 跳躍列表以及跳躍表的curd和元素排名Redis
- Redis為什麼要使用跳躍表Redis
- Python複習筆記跳躍版Python筆記
- Redis原始碼解析之跳躍表(一)Redis原始碼
- Redis原始碼解析之跳躍表(三)Redis原始碼
- 資料結構:跳躍連結串列資料結構
- 【轉】跳躍表-原理及Java實現Java
- LeetCode 45. 跳躍遊戲 IILeetCode遊戲
- 【Java】跳躍表的實現以及用例測試Java
- MySQL8.0之跳躍範圍掃描MySql
- LeetCode 45跳躍遊戲&46全排列LeetCode遊戲
- 跳躍式索引(Skip Scan Index)淺析 - 轉索引Index
- 為你的 Python 平臺類遊戲新增跳躍功能Python遊戲
- 奔跑、跳躍、攀爬,遊戲基礎動作的趣味設計遊戲
- 資料結構與演算法---跳躍表資料結構演算法
- css3實現div簡單跳躍效果CSSS3
- 漫畫演算法:什麼是跳躍表?演算法
- 跳躍式索引掃描(index skip scan) [final]索引Index
- "跳躍"在遊戲中的運用,多樣化關卡和戰鬥技能,唯一的信仰之躍遊戲
- 自定義View合輯(8)-跳躍的小球(貝塞爾曲線)View
- 修復identity 型別欄位資料的跳躍(轉)IDE型別
- 【最完整系列】Redis-結構篇-跳躍列表Redis