toggle menu
Categories
Discussions
Dashboard
Sign In
·
Register
Sign In
·
Register
Categories
Discussions
Dashboard
Sign In
·
Register
×
Home
›
Commercial / "Help Wanted"
›
[$] Coding/Programming or Logic Services
constrained Actor
polimerjones
Member
Posts:
50
June 2013
in
[$] Coding/Programming or Logic Services
When actor1 is constrained to actor2 when they move only actor2 can tell that its moving. does anyone know a work around for this?
Comments
DarkUndeadSpawn
Member
Posts:
64
July 2013
Please explain a little more or else people will just skip this.
ericzingeler
Member
Posts:
334
July 2013
edited July 2013
@polimerjones
This is because constraining to a position is not actually moving, but instead changing the position coordinates at a very fast rate.
Do this instead:
constrain actor1.motionLinearVelocityX to (actor2.posX - actor1.posX)*20
constrain actor1.motionLinearVelocityY to (actor2.posY - actor1.posY)*20
Note: make 20 higher for more responsive, or less for less responsive
polimerjones
Member
Posts:
50
July 2013
Thanks i will try this
Sign In
or
Register
to comment.
Comments
This is because constraining to a position is not actually moving, but instead changing the position coordinates at a very fast rate.
Do this instead:
constrain actor1.motionLinearVelocityX to (actor2.posX - actor1.posX)*20
constrain actor1.motionLinearVelocityY to (actor2.posY - actor1.posY)*20
Note: make 20 higher for more responsive, or less for less responsive