playMaker

Author Topic: RigidBody properties[SOLVED]  (Read 2878 times)

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 816
RigidBody properties[SOLVED]
« on: November 08, 2024, 11:53:56 AM »
it would be nice to have actions to get and set the properties of a Rigidbody 2D/3D at runtime.
« Last Edit: December 04, 2024, 08:47:28 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15612
  • Official Playmaker Support
Re: RigidBody properties
« Reply #1 on: November 11, 2024, 06:21:32 AM »
Hi,

Maybe I don't understand but you actually can use GetProperty and SetProperty on any components really, so I don't see why not with RB2d and 3d?

Can you elaborate what doesn't work for you?

Bye,

Jean

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 816
Re: RigidBody properties
« Reply #2 on: November 16, 2024, 11:17:35 AM »
Yes but I took on the habit to avoid relying on grabbing a component and modifying its values through this method. I prefer dedicated actions. And I don't trust the Linker Wizard because after all these years I still have no idea what it's really doing, it's not a very transparent process and I think a long long time ago I even posted about this.
Besides this is not possible anyway because I'm trying to modify bit mask options for constraints and it's weird. Then I looked into how to create an action with the &= and |= operators and it was all too weird.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15612
  • Official Playmaker Support
Re: RigidBody properties
« Reply #3 on: November 17, 2024, 03:29:58 AM »
Hi,

The linker wizard is registering every class you access using reflections and explicitly add them to the build, because Unity can not guess what class you use when you resort to reflection in PlayMaker actions, it's blind to it, so you have to turn on the wizard, play the game and it will catch these classes. It's a unity issue, not a PlayMaker issue.

https://docs.unity3d.com/6000.0/Documentation/Manual/unity-linker.html

https://hutonggames.com/playmakerforum/index.php?topic=11126.0


but yes, get and set properties should be used when you have no other choices, and a proper dedicated custom actions is the way to go.

I think I did some actions for this on the Ecosystem, have you searched for it?

Bye,

Jean

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 816
Re: RigidBody properties
« Reply #4 on: December 04, 2024, 05:11:56 AM »
but yes, get and set properties should be used when you have no other choices, and a proper dedicated custom actions is the way to go.

I think I did some actions for this on the Ecosystem, have you searched for it?

Sorry for the late reply.
Somehow I missed them the first time which is weird because I looked for "rigid" "rigidbody" and "constraints" and searching in the Ecosystem is my default option whenever I can't find an action that satisfies my requirements. Anyway, I found "Set RigiBody 2D Constraints" and that's what I had been looking for.
The code is in fact much simpler than what I was led to believe I needed to do after reading several posts on other coding websites.