Added a bit of sucking to pressers

This commit is contained in:
2026-04-22 00:37:55 +01:00
parent 5fd23e259c
commit 84d0e1d115
3 changed files with 13 additions and 6 deletions

View File

@@ -71,7 +71,7 @@ BoxCollider2D:
m_UsedByEffector: 0 m_UsedByEffector: 0
m_CompositeOperation: 0 m_CompositeOperation: 0
m_CompositeOrder: 0 m_CompositeOrder: 0
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 3}
m_SpriteTilingProperty: m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0} border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0, y: 0} pivot: {x: 0, y: 0}
@@ -81,7 +81,7 @@ BoxCollider2D:
drawMode: 0 drawMode: 0
adaptiveTiling: 0 adaptiveTiling: 0
m_AutoTiling: 0 m_AutoTiling: 0
m_Size: {x: 150, y: 110} m_Size: {x: 150, y: 105}
m_EdgeRadius: 0 m_EdgeRadius: 0
--- !u!114 &8140780552350643576 --- !u!114 &8140780552350643576
MonoBehaviour: MonoBehaviour:
@@ -508,7 +508,7 @@ BoxCollider2D:
m_UsedByEffector: 0 m_UsedByEffector: 0
m_CompositeOperation: 0 m_CompositeOperation: 0
m_CompositeOrder: 0 m_CompositeOrder: 0
m_Offset: {x: 0, y: -52} m_Offset: {x: 0, y: -47}
m_SpriteTilingProperty: m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0} border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0, y: 0} pivot: {x: 0, y: 0}
@@ -518,7 +518,7 @@ BoxCollider2D:
drawMode: 0 drawMode: 0
adaptiveTiling: 0 adaptiveTiling: 0
m_AutoTiling: 0 m_AutoTiling: 0
m_Size: {x: 88, y: 16} m_Size: {x: 88, y: 6}
m_EdgeRadius: 0 m_EdgeRadius: 0
--- !u!1 &8718160904021803034 --- !u!1 &8718160904021803034
GameObject: GameObject:

View File

@@ -27,6 +27,15 @@ namespace Fruitomation.Game
EffectTrigger.SetAction(other => CurrentContainedObjects.Remove(other.gameObject), EffectTrigger.SetAction(other => CurrentContainedObjects.Remove(other.gameObject),
TriggerType.Exit TriggerType.Exit
); );
EffectTrigger.SetAction(other =>
{
if (other.transform.parent.TryGetComponent(out Rigidbody2D body))
{
Debug.Log(body.name);
body.AddForce(Vector3.down * 5f, ForceMode2D.Force);
}
}, TriggerType.Stay);
} }
private void Update() private void Update()

View File

@@ -27,8 +27,6 @@ namespace Fruitomation.Game
if (hit.collider is null) if (hit.collider is null)
{ {
Vector3 force = new(-transform.localScale.x, 0f, 0f); Vector3 force = new(-transform.localScale.x, 0f, 0f);
Debug.Log(mag);
body.AddForce(force * (12f / mag), ForceMode2D.Force); body.AddForce(force * (12f / mag), ForceMode2D.Force);
} }
} }