How do I make a bat swing and return it to original state

  • Dear all,

    I've been working on my first gaming attempt. It's basically pong with baseball bats. The idea is the you can swing your bat and therefore accelerate the ball. Everything is basically working except for swinging of the bat.

    I want the bat to swing (approx. 270degrees) and then after 2 seconds return (wait function) to the original position.

    how do I do this?

  • Are you using physics or bullet behavior for the ball and bats?

    You need to use Rotate towards angle 270 and then a wait to pause and then rotate back to original angle.

    If you are using physics you would need a limited revolution joint that rotates to an angle with impulse and force to return it to it's former angle.

  • aah thanks lamar! I am using the physics approach, so i'll look at the limited revolution joint!

    Appreciate it

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • aah thanks lamar! I am using the physics approach, so i'll look at the limited revolution joint!

    Appreciate it

    Yes- limited revolution joint and you may need to step the inclinations to get it to contact the ball properly.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)