Moving Objects Based with players

Hey Everyone!

Hi guys, me and my friend are currently working on our cannons! We have based them off a game called holdfast. In this game you can move the cannon around with your player by going up to the wheel and hitting “E”, then all your movements move the cannon.

Heres what the game looks like:

heres what we got so far:
https://i.gyazo.com/0c9d94741aef758a3e014aeda02eefe7.mp4

So when you hit E on our cannon, the animation plays, and the walkspeed, and jumppower goes down to 0, but we want it so the players can move the cannon forward and backwards using W, and D and if you are on the left wheel you can hit A to turn it left, and right tap D to turn it right.

We are wondering whats the best was we get around this and make it move!

Any help loved!

3 Likes

I mean I’m not really sure about this but you can try using InputService and Keydown to move the cannon together with your CFrame? Possibly not the best way but it is possible to move it like that. Using :lerp would probably make it the smoothest way I guess. As of right now that’s as much of an idea as I have.

Alright… Thank you we will try this!

Just try adding checks for when W and D were pressed, and then making it move based on the CFrame of the character if moved at all.

It may be easier to use Hinge Constraints on the wheels instead of CFrame. Each player can then just press W or D to change the rotation of their wheel. I don’t think you will need to add keybinds for A & D since you can just have one person move forwards and the other move backwards to rotate the cannon.

You also have to remember that we want the players to move with the cannon