How do I Implement Turret Behavior to a multiplayer Game

0 favourites
  • 4 posts
From the Asset Store
The official Scirra Multiplayer Signalling Server for helping peers find and connect to each other
  • HI!

    I am trying to tackle a simple multiplayer action game (and I know it`s nowhere near of simple to implement).

    Anyways, wanted to ask if there`s anyway to use turret behavior to "target" another player?

    I mean like attaching turret to player (peer) and to add target enemy player (peer).

    I am using the real time multiplayer example to test this out, so i do not have CAPX that would clarify this more.

    Also if turret behavior cannot pick specific peer (which I suspect is the case), is there a way to pick different Peers "manually"? For example use lookX lookY variables to aim at the location of another peer. I have experimented with this but I am having really hard time picking specific peers..

    Anyway, I hope some1 can point me to right direction.


    I`ve figured out some bits of this. I got "AutoAim" to work from host side on prototype level.

    I used: set lookx to Peer(Peer.peerid<>Multiplayer.MyID).X

    to pick enemy player and to set player Aim Position.

    Now i need to figure out how to do this on the peer side.

    Again, any help is welcome.

    Also here`s Capx ... .capx?dl=0

  • I would relay the target ID (target PeerID) and set the angle for a turret towards that peers X,Y

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for getting back to me lennaert.

    I got this to work, with a little workaround.

    I created separate sprite as a target for the turret. Then attached target sprite to only those peers that are not the player.

    Works like a charm, but since there is now second object that moves 1 tick or in multiplayer environment 2 ticks after the peer, the latency might be an issue.

    I`ll have to test this more and maybe try to find some improvements.

    Thanks anyway, and here`s Capx to show my progress. ... .capx?dl=0

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