Fix blood bug again and start camera at player
This commit is contained in:
parent
9d039e8750
commit
86ecaaf7a3
@ -35,7 +35,7 @@ namespace Saltosion.OneWeapon {
|
|||||||
Vector2 AppliedMovement = Velocity * Time.fixedDeltaTime;
|
Vector2 AppliedMovement = Velocity * Time.fixedDeltaTime;
|
||||||
|
|
||||||
RaycastHit2D Hit = Physics2D.Raycast(transform.position, AppliedMovement, AppliedMovement.magnitude);
|
RaycastHit2D Hit = Physics2D.Raycast(transform.position, AppliedMovement, AppliedMovement.magnitude);
|
||||||
if (Hit.rigidbody != null) {
|
if (Hit.rigidbody != null && Hit.rigidbody.gameObject == Hit.collider.gameObject) {
|
||||||
bool IsStatic = Hit.rigidbody.bodyType == RigidbodyType2D.Static;
|
bool IsStatic = Hit.rigidbody.bodyType == RigidbodyType2D.Static;
|
||||||
Velocity = Velocity.normalized * Mathf.Min(IsStatic ? 15.0f : 60.0f, Velocity.magnitude);
|
Velocity = Velocity.normalized * Mathf.Min(IsStatic ? 15.0f : 60.0f, Velocity.magnitude);
|
||||||
CurrentlyStuckOn = Hit.rigidbody;
|
CurrentlyStuckOn = Hit.rigidbody;
|
||||||
|
@ -18,6 +18,7 @@ namespace Saltosion.OneWeapon {
|
|||||||
private void Start() {
|
private void Start() {
|
||||||
Camera = GetComponent<Camera>();
|
Camera = GetComponent<Camera>();
|
||||||
Offset = transform.position;
|
Offset = transform.position;
|
||||||
|
transform.position = Player.position + Offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Update() {
|
private void Update() {
|
||||||
|
Loading…
Reference in New Issue
Block a user