Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Fat Pug Studio on January 08, 2017, 10:56:14 AM

Title: Translate Movement unexpected behaviour [SOLVED]
Post by: Fat Pug Studio on January 08, 2017, 10:56:14 AM
Hello,

i'm using a quite simple FSM for translating the object depending on its position. I get the objects position, and i compare it to float values, which are thresholds that determine the movement direction.

(https://s26.postimg.org/a2io5pwzt/image.jpg)

As you can see, there are four possible outcomes:

1. If the object is instantiated on the upper portion of the screen, it translates down
2. If the object is instantiated on the lower portion of the screen, it translates up
3. If the object is instantiated on the left portion of the screen, it translates right
4. If the object is instantiated on the right portion of the screen, it translates left

3 and 4 work great, but when it instantiates up or down, the Y axis movement is ok, but it also applies the same amount of translation to the negative X axis, so the object move down/left when it is instantiated in the upper part of the screen, and up/left when it's instantiated in the lower part of the screen.

Any ideas what's going on? No translation is being set until the final states.
Title: Re: Translate Movement unexpected behaviour
Post by: Fat Pug Studio on January 08, 2017, 11:04:08 AM
I manually set nonaltered transition values to "0" instead of "none" and it works ok. I think this is a bug.
Title: Re: Translate Movement unexpected behaviour
Post by: jeanfabre on January 09, 2017, 02:36:29 AM
Hi,

 can you make a screenshot of that action with "nonAltered" property? I am not sure I understand where you are.

 Bye,

 Jean
Title: Re: Translate Movement unexpected behaviour
Post by: Fat Pug Studio on January 09, 2017, 05:54:55 PM
Here it is

(https://s28.postimg.org/f7qxd3fml/image.jpg)

When i set X to "none" instead of "0", it begins behaving like described.
Title: Re: Translate Movement unexpected behaviour
Post by: jeanfabre on January 10, 2017, 02:07:29 AM
Hi,

Is it a RigidBody you are trying to move?

Bye,

 Jean
Title: Re: Translate Movement unexpected behaviour
Post by: Fat Pug Studio on January 10, 2017, 02:48:41 AM
Hi Jean,

yes, Rigidbody 2D.
Title: Re: Translate Movement unexpected behaviour
Post by: jeanfabre on January 11, 2017, 04:19:41 AM
Hi,

 Then , it's likely a corruption between the transform and the rigidBody.

 Can you try with non rigidbodies?

Can you also try to use MovePosition, which is how it's intended to be done with Unity.

(http://i.imgur.com/y2SirMW.png)

 Bye,

 Jean
Title: Re: Translate Movement unexpected behaviour
Post by: Fat Pug Studio on January 11, 2017, 05:23:52 AM
Hello Jean,

i haven't tried non rigidbodies, i'll test it out and let you know.

Move Position is, at least for me, too much complication for such a game, i'd have to save coordinates as variables, than add float just to move the object, translate works much simpler for linear movement.

Thanks!