GDevelop icon indicating copy to clipboard operation
GDevelop copied to clipboard

New action for Physics behavior: Set the linear velocity towards an angle

Open tristanbob opened this issue 2 years ago • 6 comments

This currently is not working. Can someone help me troubleshoot this?

Here is the event:

Screenshot 2023-09-19 150500

...and the error output:

Screenshot 2023-09-19 150542

tristanbob avatar Sep 19 '23 21:09 tristanbob

I think this problem is very simple, can I get a hint? I recompiled GDevelop.js but it did not help.
Here is the compiled runtime javascript:

image

tristanbob avatar Sep 23 '23 04:09 tristanbob

Bump. Can someone help me with this? It's very simple and small, but not working. I must be overlooking something.

tristanbob avatar Dec 14 '23 21:12 tristanbob

Can you share the project? I don't see any function like this in the current codebase. https://github.com/search?q=repo%3A4ian%2FGDevelop%20setLinearVelocityAngle&type=code

4ian avatar Dec 15 '23 09:12 4ian

Can you share the project? I don't see any function like this in the current codebase. https://github.com/search?q=repo%3A4ian%2FGDevelop%20setLinearVelocityAngle&type=code

Thanks for your response. I have attached the project. It's a single sprite with physics behavior and a single action to set the linear velocity of the object.

set-linear-velocity-game.zip

You probably could not find it with your search because the branch is on my repo: https://github.com/search?q=repo%3Atristanbob%2FGDevelop++setLinearVelocityAngle&type=code

tristanbob avatar Dec 24 '23 23:12 tristanbob

The commit that includes this function is here:

https://github.com/4ian/GDevelop/pull/5670/commits/f19d8ceccb826313136d9a5f08d5e865a744969a

tristanbob avatar Dec 24 '23 23:12 tristanbob

I would like to use this feature in a game I'm building, and it reminded me that this feature is not added yet. I'll try to review it again tomorrow to see if I can get it to pass tests.

tristanbob avatar Jan 20 '24 04:01 tristanbob

It's working!!!

Reason it didn't work? We MUST run the electron app at least once.

https://github.com/4ian/GDevelop/assets/8879811/90836211-26ff-4513-ae28-5fd1c92322e9

Project files: SetLinearSpeedPhysics.zip

More context: https://twitter.com/VictrisGames/status/1770625683603259765

tristanbob avatar Mar 21 '24 01:03 tristanbob

This PR is ready to be reviewed.

tristanbob avatar Mar 22 '24 11:03 tristanbob

I reverted the two commits I had made after running "npm format" in two different directories. I guess those weren't needed! Now, the PR only includes the changes I wanted!
I tested it after these changes and it worked great. Thanks for your help!

tristanbob avatar Mar 27 '24 02:03 tristanbob

Thanks for this new action!

AlexandreSi avatar Mar 27 '24 07:03 AlexandreSi