3D Spiderman Swiniging System using only Character Controller without Rigidbody

Hey there,

I’ve been trying to get a swinging system to work for the past 3 weeks.
I’ve seen several tutorials that use Spring Joints, but that doesn’t work well with Character Controller and my player always ends up falling through collision when the spring joint is activated.
So I’m trying to use the pendulum equation to achieve the swing movement but it totally not working.
I don’t know if this is the right way to make a swing system so I’m hoping someone can help me with how to fix this or what other technique I should use.

// Update is called once per frame
    void Update()
    {
        Vector3 velocity = (transform.position - previousPosition) / Time.deltaTime;
        previousPosition = transform.position;

        float dot = Vector3.Dot(velocity, transform.position - anchorPoint.transform.position);
        Vector3 normalize = Vector3.Normalize(transform.position - anchorPoint.transform.position);
        swingMovement = ((normalize * dot) * -2f);

        Vector3 gravity = Vector3.down * 9.81f * Time.deltaTime;

        character.Move((gravity + swingMovement) * Time.deltaTime);
    }

Hi, I have no time to sit down and do physics calculations, so I can’t help you for real. I just remembered that I bookmarked an old article in the subject a couple years ago, you may want to check it out if you haven’t done it yet. Maybe it will help you.

I’m not sure if I’m doing something wrong or his explanation doesn’t apply so much to the way Unity works.
But there must be a way to do this with Character Controller instead of Rigidbody.

bump, still can’t figure this out :frowning: