playMaker

Author Topic: actions for the new physics update  (Read 5635 times)

cel

  • Full Member
  • ***
  • Posts: 132
actions for the new physics update
« on: January 31, 2019, 08:07:40 AM »
Hi,

Would it be possible to get actions for the new physics update, like for example the PhysicsScene methods and maybe a tutorial about simulations??

Thanks

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: actions for the new physics update
« Reply #1 on: February 01, 2019, 04:37:47 AM »
Hi,

 It's a very new feature and I have trouble understand what it brings on the table. What do you think it will help you achieve that you can not achieve already?

If you have some links, I'll study them.

Bye,

 Jean

cel

  • Full Member
  • ***
  • Posts: 132
Re: actions for the new physics update
« Reply #2 on: February 01, 2019, 06:07:45 AM »
What I had in mind was the trajectory simulation as seen here is the pool example video:

https://blogs.unity3d.com/2018/11/12/physics-changes-in-unity-2018-3-beta/

and the only docs I could find:

https://docs.unity3d.com/2018.3/Documentation/ScriptReference/PhysicsScene.Simulate.html

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: actions for the new physics update
« Reply #3 on: February 04, 2019, 01:32:19 AM »
Hi,

 that sounds very cool, but without a clear working sample, we are going to struggle... the quick code snippet in the doc raises many questions.

I'll try to see if I can find a working sample by the dev team, If you stumble upon one, bump this thread :)

Bye,

 Jean


cel

  • Full Member
  • ***
  • Posts: 132
Re: actions for the new physics update
« Reply #4 on: March 04, 2019, 03:38:47 AM »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: actions for the new physics update
« Reply #5 on: March 05, 2019, 12:02:08 AM »
Hi,

 nice, that will do indeed. I'll start tackling this. I don't expect to have the time to finish it before end of march, so make sure you bump me the last week of march to make sure I am on it :)

 Bye,

 Jean

cel

  • Full Member
  • ***
  • Posts: 132
Re: actions for the new physics update
« Reply #6 on: March 30, 2019, 06:26:50 AM »
A friendly bump

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: actions for the new physics update
« Reply #7 on: April 01, 2019, 04:14:30 AM »
Hi,

 yes, I have planned to work work on this, I need to first finish pun 2 support for end of april, as there is a talk in asia that will use this, once I am done with that I'll tackle this.

 Bye,

 Jean

cel

  • Full Member
  • ***
  • Posts: 132
Re: actions for the new physics update
« Reply #8 on: April 22, 2019, 07:37:25 AM »
Any news on this?

cel

  • Full Member
  • ***
  • Posts: 132
Re: actions for the new physics update
« Reply #9 on: May 13, 2019, 04:06:15 AM »
thought this could be helpful as well:


cel

  • Full Member
  • ***
  • Posts: 132
Re: actions for the new physics update
« Reply #10 on: May 17, 2019, 03:51:07 AM »
bump

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: actions for the new physics update
« Reply #11 on: May 20, 2019, 03:28:04 AM »
Hi,

 I am currently overloaded, but it's still something I want to do eventually, so please keep bumping, It's not being ignored :) just post pone unfortunately.

 Bye,

 Jean

cel

  • Full Member
  • ***
  • Posts: 132
Re: actions for the new physics update
« Reply #12 on: May 27, 2019, 03:39:04 AM »
bump

cel

  • Full Member
  • ***
  • Posts: 132
Re: actions for the new physics update
« Reply #13 on: May 30, 2019, 06:26:34 AM »
found another tutorial that might be useful

https://physics-labs.com/2019/04/01/physicsscene-simulate/

kaniballo

  • Playmaker Newbie
  • *
  • Posts: 10
Re: actions for the new physics update
« Reply #14 on: May 30, 2019, 07:04:38 PM »
,... i'm not expert not programmer also,... but i'll try to explain/contribute,.. forgive me if ,... :)

1. Create Physic Scene by Name with turn off auto-simulation (from attachment),...  Create new scene (Local Physical Scene) - parallel on main/default scene,... created new scene is added additively at runtime i.e pop-up in Hierarchy i.e if you stop Play newly created Local Physical Scene disappear,...

2. Auto Simulation On Off (attachment) control when main/default Unity scene will receive physic,... Auto Simulation On is for Default Unity Scene Only,... newly created Local Physical Scene has other form of control - Physics Scene Simulation,...

3. Physics Scene Simulate On Off (attachment) - control when Local Physical Scene
receive physic,... it's bool variable who check every frame - tick on simulation begun,... tick off simulation stop.
,... again i'm not a programmer and this Actions may be not good or they are "green inside",... :)

,...example how to use ,...
1. Create Plane Scale 10x1x10 to use as floor name Floor Local Physical Scene 1
2. Duplicate Plane/floor with name Floor Local Physical Scene 2
3. Create Box to use as wall put him perpendicular on floor name Wall Local Physical Scene 1
4. Duplicate box/wall with name Wall Local Physical Scene 2
5. Create Sphere (add Rigidbody Component) with name Ball Local Physical
 Scene 1
6. Duplicate Sphere/ball name Ball Local Physical Scene 2

on Playmaker side,... Create new FSM on empty game object,...
1. create new state and put there Create Physic Scene (from attachment),... give name - Local Physical Scene 1 (will pop-up on runtime)
2. again in same state Create Physic Scene (from attachment),... give name - Local Physical Scene 2 (will pop-up on runtime)
 ,... (little explanation - We must put some objects for physical simulation in newly created two Local Physical Scenes,... we have 2 floors two walls and two balls, but they are in default/main Unity scene - again we must put them in Local Physical Scenes, if objects that we created are in hierarchy (root) we can move straight ahead with (Move Game Object To Scene Action) from default Playmaker actions ,... if objects who need to move to Local Physical Scenes are prefabs - we must use (Create Object) action again from default Playmaker,..
3. Again in same state create Move Game Object To Scene Action - 3 times,... move once floor ,... then box ,... and sphere,.. use scene reference by name and don't use any events from result (we need only to move objects  to physical local scene 1) ,...
4. again in same state Move Game Object To Scene Action - 3 times,... move flor,bos,sphere 2 to local scene 2,... put Finish transition and create new state,..
6.  in new state create two time Physic Scene Simulate (from attachment)
set them as local scene 1 and local scene 2 (if you wish set different time scale)
,...less then 1 physic simulation slow ,... more then 1 get speed,...
7. in same state add two default playmaker actions (Add Force) set them corresponding to Spheres/Balls 1 and 2 set x0,y15,z15 (or vector/force where is wall) set force to impulse.
 that is all about setup ,.. is little long :)
,... after play you will see one sphere/ball (actually two in one - put them to spawn separately) moving from add force impulse to wall,... potentially with different slow/fast effect,... completely independent from one other  ,.... :)
 ,... Conclusion what we have - 3 completely independent from one other physical scenes (default/main need autosimulation on + 2 local physical scenes)- with independent physical steps,... if you wish trajectory get position from one physical scene ball put in array/list and spawn/instantiate many small(trajectory mark) in those positions,... i hope someone help ,... and sorry for long explanation :)