Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: mr.ffish on November 29, 2016, 05:42:36 PM

Title: question about best way to move 2D rigidbody[SOLVED]
Post by: mr.ffish on November 29, 2016, 05:42:36 PM
I recently read that it is very expensive to translate colliders without rigidbodies. I also read that it is much better to use rigidbody.move.position rather than transform or translate. I found the "rigidbodyMovePosition"action in the ecosystem, but it only applies to the 3D rigidbody.

I understand using add force2d and set velocity2d, but I am trying to move a 2d rigidbody "forward" so that when i use LookAt2d, it will move towards the target instead of just turning towards the target while drifting off in the direction I have added force or set velocity to. When I use translate on X, it does exactly what I want, but if that method is really more expensive, then is there any way to achieve the same behavior with a rigidbody.move, over using translate?

I have been using Playmaker for a few weeks now, and I have an amazing looking retro-2d-platformer well on it's way. However, I am getting into some complex enemy movements, and I am running into some severe slow down. I am trying really hard to isolate the source, and I believe it has to do with how much I am translating my enemies.

Any help at all would be much appreciated. I have much faith in my trusty Playmaker asset, and I am sure that this is just a lack of knowledge on my part. If anyone knows any ways to improve performance with 2d physics i.e. moving rigidbodies, I would be very much appreciative.

This issue has pretty much halted my games progress entirely until I can get it fixed. I want to make sure I am using the most efficient (least expensive) methods possible so that I don't spend another two weeks programming choppy physics.

Thank you in advance.

--mr.ffish
Title: Re: question about best way to move 2D rigidbody
Post by: jeanfabre on December 01, 2016, 03:44:12 AM
Hi,

 yes, I made two new actions on the Ecosystem to move and rotate 2d rb, can you give this a try?

(https://pbs.twimg.com/media/CylAPKCWgAA3q9R.jpg)

Let me know if that helps.

bye,

 Jean
Title: Re: question about best way to move 2D rigidbody
Post by: mr.ffish on December 02, 2016, 03:15:55 PM
Ahhh! you are so awesome for doing this!

I am getting this error though:

Actions/Physics2D/Rigidbody2dMovePosition.cs(9,48): error CS0246: The type or namespace name `ComponentAction`1' could not be found. Are you missing a using directive or an assembly reference?

I am using unity 5. Is there something I am missing?
Title: Re: question about best way to move 2D rigidbody
Post by: jeanfabre on December 03, 2016, 06:23:49 AM
Hi,

 Odd. What version of PlayMaker do you use?

Bye,

 Jean
Title: Re: question about best way to move 2D rigidbody
Post by: mr.ffish on December 03, 2016, 01:22:01 PM
I am trying to figure it out, but I don't see the version anywhere in my project. I have a lot of different actions that I have accumulated over the weeks, and they all work. For some reason I just can't get these to. I reimported playmaker to see if it would work then but I am still getting the error. Is there something I can change in the code to make it work?

Please help, i am so excited to start using these new actions. According to the error, it's the "ComponentAction" that could not be found. Am I overlooking something?

Thank you for your help.

--mr.ffish
Title: Re: question about best way to move 2D rigidbody [Solved]
Post by: mr.ffish on December 03, 2016, 03:20:42 PM
Ha! I updated and everything is fine now (:::

Thank you so much for your help with this. I am so excited to get back to development. This really is a great community!

--mr.ffish
Title: Re: question about best way to move 2D rigidbody
Post by: jeanfabre on December 05, 2016, 12:50:33 AM
:)

 Let us know if it improved the situation!

 Bye,

 Jean
Title: Re: question about best way to move 2D rigidbody
Post by: Spunkyinteractive on December 05, 2016, 05:30:50 AM
I'm also really interested to know if this improved your perf. Please post back with your findings when you get a chance :)
Title: Re: question about best way to move 2D rigidbody
Post by: Krillan87 on March 27, 2019, 08:52:11 AM
Hi,
Is there an action (or a way to improve this action) to add the options that are in the "move object" action? So the option to add a Time, speed, delay, ease type etc. to the rigid body 2d move position?

Or is there no use for those options? Maybe i have misunderstood how functionality here.
Title: Re: question about best way to move 2D rigidbody
Post by: jeanfabre on March 28, 2019, 05:30:38 AM
Hi,

 sure, I'll work on that. ping early next week if I haven't done it by that time.

 Bye

 Jean
Title: Re: question about best way to move 2D rigidbody
Post by: jeanfabre on March 29, 2019, 03:54:15 AM
Hi,

 Ok, it's on the Ecosystem, called MoveRigidbody2D.

 let me know how it goes. If it works ok for you. I'll tweet about it.

 Bye,

 Jean
Title: Re: question about best way to move 2D rigidbody
Post by: Krillan87 on April 25, 2019, 09:54:37 AM
Hi,

 Ok, it's on the Ecosystem, called MoveRigidbody2D.

 let me know how it goes. If it works ok for you. I'll tweet about it.

 Bye,

 Jean

Hi,

Sorry for late reply. It works like a charm! thanks!