We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Será que a força que o herói joga o objeto carregavel não deveria ser um parâmetro do herói?
public void ReleaseObject(){ Carriable carriable = CarriedObject.GetComponent<Carriable> (); float fator = (carriable.isHeavy()?1.5f:1); SliderJoint2D sliderJoint = GetComponent<SliderJoint2D>(); sliderJoint.connectedBody = null; sliderJoint.enabled = false; if (Crouched) { CarriedObject.GetComponent<Rigidbody2D> ().velocity = new Vector2 (0, 0); CarriedObject.transform.rotation = new Quaternion(0, 0, 0, CarriedObject.transform.localRotation.w); CarriedObject.transform.position = new Vector2 (transform.position.x + facingDirection * transform.localScale.x/2 + facingDirection * CarriedObject.transform.localScale.x/2, transform.position.y - transform.localScale.y + CarriedObject.transform.localScale.y + offsetCarryObjHero*fator); } else { CarriedObject.GetComponent<Rigidbody2D> ().velocity = new Vector2 (rigidBody2D.velocity.x, 0); CarriedObject.GetComponent<Rigidbody2D> ().AddForce (new Vector2 (fator * facingDirection * 5f, fator * 1f), ForceMode2D.Impulse); } Carrying = false; CarriedObject = null; carriable.isBeingCarried = false; animator.SetBool ("carry", false); }
Esse factor, esse valor 5f dentro do addforce, etc, deveriamos juntar tudo em um parâmetro, e o GD define a força. O que acham?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Será que a força que o herói joga o objeto carregavel não deveria ser um parâmetro do herói?
Esse factor, esse valor 5f dentro do addforce, etc, deveriamos juntar tudo em um parâmetro, e o GD define a força. O que acham?
The text was updated successfully, but these errors were encountered: