Ich habe ein Problem, ich mache einen Dialog Text in Einheit mit C#. Nun, ich muss wissen, wie deaktiviert Sprung von ThirdPeerController (Standard-Player der Einheit), weil nicht gut ist.How to disabled Jump der dritten Person Controller - Unity C#
So:
Dies ist der Code:
private void Update()
{
\t \t if (!m_Jump) {
\t \t \t m_Jump = CrossPlatformInputManager.GetButtonDown ("Jump");
\t \t
\t \t
\t \t }
}
// Fixed update is called in sync with physics
private void FixedUpdate()
{
// read inputs
float h = CrossPlatformInputManager.GetAxis("Horizontal");
float v = CrossPlatformInputManager.GetAxis("Vertical");
bool crouch = Input.GetKey(KeyCode.C);
// calculate move direction to pass to character
if (m_Cam != null)
{
// calculate camera relative direction to move:
m_CamForward = Vector3.Scale(m_Cam.forward, new Vector3(1, 0, 1)).normalized;
m_Move = v*m_CamForward + h*m_Cam.right;
}
else
{
// we use world-relative directions in the case of no main camera
m_Move = v*Vector3.forward + h*Vector3.right;
}
#if !MOBILE_INPUT
\t \t \t // walk speed multiplier
\t if (Input.GetKey(KeyCode.LeftShift)) m_Move *= 0.5f;
#endif
// pass all parameters to the character control script
m_Character.Move(m_Move, crouch, m_Jump);
m_Jump = false;
}
}
Ich versuche
Bitte helfen Sie mir, ich weiß nicht, wie beheben es.
Danke !!
Der Code wird in einer der Klassen auf dem Spielobjekt sein. Was hast du schon probiert? – Bejasc
@Bejasc Ich aktualisiere den Beitrag für Sie sehen –
Ich habe Ihnen eine Antwort, aber das ist wirklich ein ziemlich grundlegendes Problem. Hast du diesen Code überhaupt gelesen? Bevor Sie hier Fragen stellen, sollten Sie sich bemühen und versuchen, das Problem selbst zu beheben, und hier detailliert angeben, was Sie bereits versucht haben. – Bejasc