[Diving] Movement with a rock and 3 ropes is working
This commit is contained in:
@@ -4,6 +4,12 @@ public class EndlessDescenderController : MonoBehaviour, ITouchInputConsumer
|
||||
{
|
||||
private float targetFingerX;
|
||||
private bool isTouchActive;
|
||||
private float originY;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
originY = transform.position.y;
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
@@ -44,8 +50,14 @@ public class EndlessDescenderController : MonoBehaviour, ITouchInputConsumer
|
||||
moveStep = Mathf.Clamp(moveStep, -absOffset, absOffset);
|
||||
float newX = currentX + moveStep;
|
||||
newX = Mathf.Clamp(newX, GameManager.Instance.EndlessDescenderClampXMin, GameManager.Instance.EndlessDescenderClampXMax);
|
||||
Vector3 oldPos = transform.position;
|
||||
transform.position = new Vector3(newX, transform.position.y, transform.position.z);
|
||||
float newY = originY;
|
||||
// Add vertical offset from WobbleBehavior if present
|
||||
WobbleBehavior wobble = GetComponent<WobbleBehavior>();
|
||||
if (wobble != null)
|
||||
{
|
||||
newY += wobble.VerticalOffset;
|
||||
}
|
||||
transform.position = new Vector3(newX, newY, transform.position.z);
|
||||
// Debug.Log($"EndlessDescenderController: Moved from {oldPos} to {transform.position} (targetX={targetX}, lerpSpeed={lerpSpeed}, offset={offset}, exponent={exponent}, moveStep={moveStep})");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user