So, I’m new to gdevelop and to programming in general, so excuse me if this is a noob mistake, but I just have no idea of what might be causing this issue.
What happens is that I programmed an object (physics 2.0) to move in the mouse direction with N force. That goes well. Then I made two variables that are set to X and Y values of the object after the movement happens, and a key pressing command that moves the char to the object’s position through the variables I set earlier.
The problem is, when I throw the object (say it lands in position A), then press the key to move the char after, it does nothing. If I throw the object again (landing in position B), then the char moves, but to the previous position (position A).
There’s the sequence of conditions and actions I set:
No other place. Do you think it could have anything to do with the BlueGem physics 2.0 configurations? Dinamic, ball, density 3, angular damping 1, all else is as standard. The character does not have the physics 2.0 behavior, though.
Hey! Fixed the problem. By changing the action that sets the blink variables (instead of being the W pressing, now its the S pressing), it worked just fine. This is the new configuration:
Found another problem though. When the ball is thrown to the left it kinda inverts the path. I point the mouse, lets say, X10 and Y10, the ball tries to move downwards. When I point downwards (X10, Y500), the ball moves upwards ‘-’ Made two text boxes so I could track the values of the mouse position, and it seems to be working as intended. Do you have any idea of what’s happening? Thank you again.
Do you mean the mouse is at position 10,10, or you are 10 pixels left and 10 pixels up from the centre of the ball? If the latter, where have you specified the point of the force be applied?
What are your physics settings for BlueGem? Can you provide a screen snip of that?
I was talking about the position of the mouse actually. Just tried to use the BlueGem center as a point to apply the force and it didn’t move at all lol
Those are the BlueGem physics (it’s configured as Dynamic with the “can sleep” box checked, just couldn’t get it all on the same print):
The parameters were all right, but I think I found the problem. Added the point to apply the forces and changed forces applied (was using forces equal to the BlueGem’s density, now the forces are way bigger). It seems to be working fine. Now I think it’s just a question of adjusting the physics to find the perfect tune. Again, thank you for your help.