playMaker

Author Topic: question about best way to move 2D rigidbody[SOLVED]  (Read 4200 times)

mr.ffish

  • Playmaker Newbie
  • *
  • Posts: 9
question about best way to move 2D rigidbody[SOLVED]
« 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
« Last Edit: March 29, 2019, 03:54:28 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: question about best way to move 2D rigidbody
« Reply #1 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?



Let me know if that helps.

bye,

 Jean

mr.ffish

  • Playmaker Newbie
  • *
  • Posts: 9
Re: question about best way to move 2D rigidbody
« Reply #2 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?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: question about best way to move 2D rigidbody
« Reply #3 on: December 03, 2016, 06:23:49 AM »
Hi,

 Odd. What version of PlayMaker do you use?

Bye,

 Jean

mr.ffish

  • Playmaker Newbie
  • *
  • Posts: 9
Re: question about best way to move 2D rigidbody
« Reply #4 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

mr.ffish

  • Playmaker Newbie
  • *
  • Posts: 9
Re: question about best way to move 2D rigidbody [Solved]
« Reply #5 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

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: question about best way to move 2D rigidbody
« Reply #6 on: December 05, 2016, 12:50:33 AM »
:)

 Let us know if it improved the situation!

 Bye,

 Jean

Spunkyinteractive

  • Playmaker Newbie
  • *
  • Posts: 22
Re: question about best way to move 2D rigidbody
« Reply #7 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 :)

Krillan87

  • Beta Group
  • Full Member
  • *
  • Posts: 185
Re: question about best way to move 2D rigidbody
« Reply #8 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.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: question about best way to move 2D rigidbody
« Reply #9 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

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: question about best way to move 2D rigidbody
« Reply #10 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

Krillan87

  • Beta Group
  • Full Member
  • *
  • Posts: 185
Re: question about best way to move 2D rigidbody
« Reply #11 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!