Blood particles distance fix

This commit is contained in:
Yann Dupont 01 2022-04-03 00:52:13 -04:00
parent eafc0c63b6
commit 48041ea26e
2 changed files with 2 additions and 1 deletions

View File

@ -105,7 +105,7 @@ ParticleSystem:
m_PreInfinity: 2 m_PreInfinity: 2
m_PostInfinity: 2 m_PostInfinity: 2
m_RotationOrder: 4 m_RotationOrder: 4
moveWithTransform: 0 moveWithTransform: 1
moveWithCustomTransform: {fileID: 0} moveWithCustomTransform: {fileID: 0}
scalingMode: 1 scalingMode: 1
randomSeed: 0 randomSeed: 0

View File

@ -78,6 +78,7 @@ public class BloodSucker : MonoBehaviour {
void PerformSuck(float deltaTime) { void PerformSuck(float deltaTime) {
bloodParticles.gameObject.transform.rotation = Quaternion.FromToRotation(transform.right, currentTarget.transform.position - transform.position); bloodParticles.gameObject.transform.rotation = Quaternion.FromToRotation(transform.right, currentTarget.transform.position - transform.position);
bloodParticles.gameObject.transform.localScale = Vector3.one * (Vector3.Distance(currentTarget.transform.position, transform.position) + 1f) / 4f;
currentSuckTimer -= deltaTime; currentSuckTimer -= deltaTime;
if (currentSuckTimer < 0f) { if (currentSuckTimer < 0f) {