Synchronise an object position based on second object angle

0 favourites
  • 3 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • Hello,

    What i wish to do is take Object A angle and set Object B position relative to the angle of Object A at a certain distance (lets say 200pixels) so if the Object A is taking another direction, the Object B must stay at 200 pixels in front of Object A at 200 pixels of position of Object A. The idea is if i am shooting object A that object b could serve as a detector in front of Object A. (This is not a line of sight only a simple detector.)

    Any ideas what i can use for this ?

    Thanks for your help! Greatly appreciated.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello,

    What i wish to do is take Object A angle and set Object B position relative to the angle of Object A at a certain distance (lets say 200pixels) so if the Object A is taking another direction, the Object B must stay at 200 pixels in front of Object A at 200 pixels of position of Object A. The idea is if i am shooting object A that object b could serve as a detector in front of Object A. (This is not a line of sight only a simple detector.)

    Any ideas what i can use for this ?

    Thanks for your help! Greatly appreciated.

    you could use the Pin behavior on ObjectB, and pin "position and angle" relative to Object A

    Or you could set ObjectB position to :

    X: 200*cos(ObjectA.Angle)+ObjectA.X

    Y: 200*sin(ObjectA.Angle)+ObjectA.Y

    Or even set an object point in the image editor 200 pixels forward the center of ObjectA, and set the position of ObjectB to it.

  • > Hello,

    >

    > What i wish to do is take Object A angle and set Object B position relative to the angle of Object A at a certain distance (lets say 200pixels) so if the Object A is taking another direction, the Object B must stay at 200 pixels in front of Object A at 200 pixels of position of Object A. The idea is if i am shooting object A that object b could serve as a detector in front of Object A. (This is not a line of sight only a simple detector.)

    >

    > Any ideas what i can use for this ?

    >

    > Thanks for your help! Greatly appreciated.

    >

    you could use the Pin behavior on ObjectB, and pin "position and angle" relative to Object A

    Or you could set ObjectB position to :

    X: 200*cos(ObjectA.Angle)+ObjectA.X

    Y: 200*sin(ObjectA.Angle)+ObjectA.Y

    Or even set an object point in the image editor 200 pixels forward the center of ObjectA, and set the position of ObjectB to it.

    Work fine! Thanks a lots for your help.

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