0
我想用與玩家推動物體剛體相同的力拉動物體。但是,我不知道如何使這樣的力量等於走進剛體的力量。Unity Pushing Object Script(Little Big Planet like)
這裏是我的代碼:
//if can push and holds button for pushing
other.GetComponent<Rigidbody>().AddForce(new Vector3(player.moveInput.x*player.speed*mass, player.moveInput.y * player.speed * mass, player.moveInput.z * player.speed * mass), ForceMode.Impulse);
現在上面的代碼只是使箱飛力比我預想的要大得多。
你是否問過如何用物體推動玩家以與他推動物體相同的力量?你也應該發佈整個代碼並更好地解釋你所要求的。 – Universus
我在問如何爲玩家提供一個拉動腳本來拉動物體,這樣當他移動物體時,保持在一定的距離內,我該如何實現這個目標? –
_「...力量等於步入剛體的力」_是什麼意思?什麼是「走路的力量」?另外,什麼是'player.moveInput'? – pingul