# moving problem

Member, PRO Posts: 47

holaaa... there is an
actor : MOTION > Linear Velocity X 250
rule > when touch or overlaps whit actor B change attribute "Linear Velocity X" change to "-Linear Velocity X"

it works good so when tha actor A toch actor B come back....

BUT

SOMETIMES the actor crash and touch the actor B and stay in the same position why??????

• GermanyMember, PRO Posts: 184
edited August 2015

Have you added a display text behavior (or log) to the actor which shows the velocity X? Just for verification, to check if it changed to 0 or remains at 250.

• Member, PRO Posts: 47

change to 0

• Member, PRO Posts: 47

realy i see i like -1.9239248923 ... ad continusly change 2.942384283 number like these

• London, UK.Member Posts: 12,822

@Reckless App said:
realy i see i like -1.9239248923 ... ad continusly change 2.942384283 number like these

When the actor hits the obstacle its linear velocity drops dramatically, you are then asking the actor to make this velocity negative.

• Member, PRO Posts: 47

so how i can make an actor touch another one and come back??

• London, UK.Member Posts: 12,822
edited August 2015

Make an integer attribute ('A') set it to 1 / set Linear Velocity X to 250.

Rule: When actor collides with obstacle
--Change A to 1-A
--Change Linear Velocity X to 250 *((A *2)-1)

• Member Posts: 106

@Reckless App See the file below. I am guessing thats what you want.

• Member, PRO Posts: 47

@Socks said:
Make an integer attribute ('A') set it to 1 / set Linear Velocity X to 250.

Rule: When actor collides with obstacle
--Change A to 1-A
--Change Linear Velocity X to 250 *((A *2)-1)

it works but

moving 250 ok and then when come back linear velocity is -750

• London, UK.Member Posts: 12,822

@Reckless App said:
. . . when come back linear velocity is -750

You've probably made a mistake when creating the rule.

• Member, PRO Posts: 47

@Socks said:

ma

maybe

• Member, PRO Posts: 47
edited August 2015

@GameAlchemist said:
@Reckless App See the file below. I am guessing thats what you want.

thanks @GameAlchemist but i would like use just one wall 'cuz i'll use lots of level

• Member Posts: 106

Check this out. Hopefully this method will work. @Reckless App

• Member, PRO Posts: 47

@GameAlchemist said:
Check this out. Hopefully this method will work. @Reckless App

the problem is if you put anothor wall in the center and jump over it when come back and touch it don't come back
hahaha
is a very simple thing but I can't understand how to fix it :

• Member, PRO Posts: 47

@Socks said:
Which mistake you thinks i made??

• Member Posts: 106

Ohhh I get it now, well I tried the method you mentioned in the first post by making it go left if lin vel x is greater than 20 and go right if lin vel x is less than 20. It works but sometimes(just as you mentioned) it doesn't work. And I am also stuck with a similar problem in my project too, instead with a linear velocity Y I want a box to know the force at which the actor is coming and sometimes it doesn't recognise the force.

• London, UK.Member Posts: 12,822

@Reckless App said:
Which mistake you thinks i made??

The first change attribute condition is wrong.

• Member, PRO Posts: 47

@Socks said:
The first change attribute condition is wrong.

yeahh... thank you very much....

• Member, PRO Posts: 47

@Socks said:
The first change attribute condition is wrong.

In the end is the same thing sometimes the actor
walk through walls

• Member Posts: 106

I solved my problem, and this file might do that for you too. All I had to do was increase the drag in the physics panel. @Reckless App