From 86ecaaf7a39eae5bceaa43c9f061795999757c47 Mon Sep 17 00:00:00 2001 From: Jens Pitkanen Date: Sun, 4 Aug 2019 21:30:05 +0300 Subject: [PATCH] Fix blood bug again and start camera at player --- Assets/Scripts/BloodParticle.cs | 2 +- Assets/Scripts/CameraFX.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/BloodParticle.cs b/Assets/Scripts/BloodParticle.cs index 0c57b64..f1486c9 100644 --- a/Assets/Scripts/BloodParticle.cs +++ b/Assets/Scripts/BloodParticle.cs @@ -35,7 +35,7 @@ namespace Saltosion.OneWeapon { Vector2 AppliedMovement = Velocity * Time.fixedDeltaTime; 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; Velocity = Velocity.normalized * Mathf.Min(IsStatic ? 15.0f : 60.0f, Velocity.magnitude); CurrentlyStuckOn = Hit.rigidbody; diff --git a/Assets/Scripts/CameraFX.cs b/Assets/Scripts/CameraFX.cs index e89b974..81bb9e8 100644 --- a/Assets/Scripts/CameraFX.cs +++ b/Assets/Scripts/CameraFX.cs @@ -18,6 +18,7 @@ namespace Saltosion.OneWeapon { private void Start() { Camera = GetComponent(); Offset = transform.position; + transform.position = Player.position + Offset; } private void Update() {