playMaker

Author Topic: Get Collision Info from another GameObject [SOLVED]  (Read 121 times)

Kubold

  • Full Member
  • ***
  • Posts: 105
    • View Profile
Get Collision Info from another GameObject [SOLVED]
« on: September 02, 2019, 10:33:24 AM »
Hi,

Please read all, before giving a template answer :)

Having an FSM attached to a tip of the sword, which is handled by an active ragdoll (so a very sophisticated physics setup), makes physics judder. Even an empty FSM makes physics look like 24-30 fps, and not 60. Unity forums say "do not attach scripts working on Update to rigid bodies".

Stock "Collision Event" Action now has an option to point to other Game Object to detect collision, and this is great, it does not cause judder, because FSM which handles it, is not attached to the rigidbody.

I would also like to get the hit point and hit force, but "Get Collision Info" Action does not have option to read other GameObjects collisions. Since attaching FSMs to ragdolls causes judder, that would be a great option to have.

TL;DR: Can you please add an option to point to other Game Object in "Get Collision Info" action? Or add an option to get hit point and force in "Collision Event" Action?
« Last Edit: September 03, 2019, 07:12:44 AM by Kubold »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4431
    • View Profile
    • jinxtergames
Re: Get Collision Info from another GameObject
« Reply #1 on: September 03, 2019, 03:29:05 AM »
Hi.
From what i understand from the code, Collision event stores the info on the fsm that uses the "Collision event" action, so if you use the "Get Collision Info" in the same fsm it should get that data.
FOR HIRE:Playmaker/C#

Playmaker Samples <-------------> Easy Exporter <---------------------> TPA Actions

Kubold

  • Full Member
  • ***
  • Posts: 105
    • View Profile
Re: Get Collision Info from another GameObject
« Reply #2 on: September 03, 2019, 03:51:38 AM »
No, it doesn't work. It only reads the info from object it is attached to.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4431
    • View Profile
    • jinxtergames
Re: Get Collision Info from another GameObject
« Reply #3 on: September 03, 2019, 05:20:18 AM »
Have you tried in a build if it still jitters?

Also when you play it is best that Inspector and Playmaker window are not visible
(or at least collapse fsms) this can greatly improve performance.

as the fsm visuals in the inspector does need to update, but in build it is very possible you don't have any issues. (or even when other windows are not visible)
FOR HIRE:Playmaker/C#

Playmaker Samples <-------------> Easy Exporter <---------------------> TPA Actions

Kubold

  • Full Member
  • ***
  • Posts: 105
    • View Profile
Re: Get Collision Info from another GameObject
« Reply #4 on: September 03, 2019, 05:50:34 AM »
Yes, I have been working on improving the physics smoothness for last 3 days, both in editor and build. So far it looks like "Get Collision Info" from other GameObject would solve all my problems. Attaching FSMs to rigidbodies makes them look choppy.

Besides, collision and trigger Actions already have that option (they did not before!), so adding this to Get Collision Info would be consistent with other collision Actions.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4431
    • View Profile
    • jinxtergames
Re: Get Collision Info from another GameObject
« Reply #5 on: September 03, 2019, 06:25:12 AM »
Hi.
I made a combined action (Attachment Below) from the 2 as its not able to reference (it has to be changed in the core of playmaker i think)
But this should work as it will get it directly from the info that will be stored.

Please let me know if it worked.
FOR HIRE:Playmaker/C#

Playmaker Samples <-------------> Easy Exporter <---------------------> TPA Actions

Kubold

  • Full Member
  • ***
  • Posts: 105
    • View Profile
Re: Get Collision Info from another GameObject
« Reply #6 on: September 03, 2019, 07:12:12 AM »
Thank you very much for making this so fast.

The Action works, but it's really hard to tell now if there is any lag... I guess that is good. Anyway, my request was answered, thank you!