Add background

This commit is contained in:
Michal Pikulski
2025-09-22 00:01:28 +02:00
parent 38f578c56a
commit 2942b22c62
5 changed files with 505 additions and 225 deletions

View File

@@ -40,9 +40,6 @@ public class RopeBreaker : MonoBehaviour
[Tooltip("Initial downward impulse for falling rope end")]
[SerializeField] private float initialFallImpulse = 2.0f;
[Tooltip("Force Y position reset on start to ensure proper falling")]
[SerializeField] private bool forceYReset = true;
// Private references
private Rope originalRope;
@@ -122,10 +119,9 @@ public class RopeBreaker : MonoBehaviour
// Set specific transform to follow instead of using tag
follower.SetTargetTransform(originalStartPoint);
follower.canFall = false; // Player rope end doesn't fall
follower.followSpeed = ropeFollowSpeed;
follower.trailing = ropeTrailing;
follower.useGravity = true; // Player rope end doesn't use gravity
// Create second break point (for the rock-attached end)
GameObject secondBreakObj = new GameObject("RopeBreakPoint_Second");
@@ -138,15 +134,13 @@ public class RopeBreaker : MonoBehaviour
// Set specific transform to follow instead of using tag
secondFollower.SetTargetTransform(originalEndPoint);
secondFollower.canFall = true; // Rock end can fall
secondFollower.followSpeed = ropeFollowSpeed;
secondFollower.trailing = ropeTrailing;
secondFollower.useGravity = true; // Enable gravity for hanging rope end
secondFollower.gravityStrength = ropeGravityStrength;
secondFollower.verticalHangStrength = ropeVerticalHangStrength;
secondFollower.damping = ropeDamping;
secondFollower.initialFallImpulse = initialFallImpulse;
secondFollower.forceYReset = forceYReset;
// Create initial separation
Vector3 direction = (originalEndPoint.position - breakPointPosition).normalized;