playMaker

Author Topic: Need a little help [SOLVED]  (Read 2416 times)

JLawton

  • Playmaker Newbie
  • *
  • Posts: 9
Need a little help [SOLVED]
« on: July 27, 2017, 06:28:23 AM »
I need a bit of help with an adjustable section of pipe i'm trying to create.

The end result i'd like is a section of pipe going from A to B, with A being in a fixed position and B being movable. I've made a section of pipe up, with 2 different states, straight and with a dogleg (Z shaped), but i feel like i've hit a wall trying to get the pipe to automatically change state from the straight section to the dogleg.

The pipe will, in all likelyhood stay horizontal, so all movement only needs to be in 2 axis

I've attached a prefab of the pipe section if anyone fancies a look. I'm using unity 5.6.1 with playmaker 1.8.4.f5.

Drag the Start / End gameobjects in the scene to adjust the pipe length and dogleg toggle is currently set to downarrow, just to toggle the bool.

Thankyou

Jim
« Last Edit: November 15, 2017, 04:01:50 AM by djaydino »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: Need a little help
« Reply #1 on: July 27, 2017, 01:37:03 PM »
Hi,
how far did you get on this, can you change it manually?

Can you show some pictures of your setup/fsm/scenes/actions?

JLawton

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Need a little help
« Reply #2 on: July 28, 2017, 04:58:29 AM »
Hi,

Thanks for your reply, yes I can adjust it manually using a bool variable to toggle the mesh renderer of different components.

I've attached an image showing the pipe setup how I have it at the moment. There's a flange either end of the pipe and you'll see a couple of bends to give the dogleg I need. At the moment if I enable to dogleg manually the right hand flange moves position to align with the lower bend. The straight section of pipe between the bend stretches (scales), as do the straight sections attached to the flanges.

I want the start / end gameobjects to control the overall length / width of the pipe, so I can snap the pipe to other components linking them together and keeping them connected when other components move around

I think I might have found a way of doing what I want, just trying to play with it and get it to work using Get Property to assign the position to a float, then when the float changes the arrangement adjusts for straight / dogleg pipework.
At the moment I can make it change to the dogleg but not back to straight pipe.

The most frustrating thing for me as a non-coder is i'm sure the whole thing could probably be achieved using code to loft an array of vertices along a path between the flanges, so using playmaker in this way feels like a poor option :( (i do love playmaker by the way, it's a great tool!)

JLawton

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Need a little help
« Reply #3 on: July 28, 2017, 05:21:03 AM »
The screenshot below shows the overall setup for my project in its current state. I'm using Hololens to show different pipe options, with a menu for selecting prefabricated components, the user will be able to pick the components they want, and position them where they want in the room using hololens. This works at the moment, but looks strange without interconnecting pipework. This is where i'm hoping this adjustable pipe will come in.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: Need a little help
« Reply #4 on: July 28, 2017, 07:44:16 AM »
Hi,
Quote
The most frustrating thing for me as a non-coder is i'm sure the whole thing could probably be achieved using code to loft an array of vertices along a path between the flanges, so using playmaker in this way feels like a poor option :( (i do love playmaker by the way, it's a great tool!)
Actually this can be done with playmaker also.
About anything what you can do in code can be done in Playmaker.

I tried your prefab but i am getting errors in console and in playmaker.
Because of a missing action : GetWorldDistance i tried looking on the Ecosystem but could not find it there.

Maybe you can make a video showing what exactly your trying to do and how for you got, i am not sure if i understand it correctly.  :-[

JLawton

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Need a little help
« Reply #5 on: July 28, 2017, 08:16:30 AM »
Actually this can be done with playmaker also.
About anything what you can do in code can be done in Playmaker.
This is interesting, this would be my preferred option as I think it would give more flexibility than my current setup.

Hopefully the images below will help to explain what i'm trying to do.
Point A will be a fixed point, connecting to an existing piece of equipment.
If I only need a straight section of pipe to connect two objects together, as in the second image, the pipe will scale horizontally.
If I need to connect to point C, the pipe will need two bends. And the object as a whole will have to flex in two directions to connect point A to point C.

Ideally I want to tell playmaker to connect one end of the pipe to one vector3 position and the other end of the pipe to another vector3 position and the software will adjust the pipe to fit without any additional input required from the user.

Additionally, the GetWorldDistance.cs action is available here: http://hutonggames.com/playmakerforum/index.php?topic=975.0
I was trying to limit the overall distance value to one axis, which GetDistance can't do.

Thanks again for your help

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: Need a little help
« Reply #6 on: July 30, 2017, 09:19:46 AM »
Hi,
I tried to work a bit with that prefab, but the only thing that worked manually
is when i pull "end" left and right.

I made a sample scene that shows how you could swap the pipe system from straight to z type
In the sample i am just swapping the material color from the cube when i reach a certain position
I used 1 custom action that i have included (float Compare With Bools) once that works we can see how to connect to the other pipe.

JLawton

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Need a little help
« Reply #7 on: August 02, 2017, 06:42:32 AM »
I think i've done it now!

I worked on it on saturday and got it almost working correctly using float compare, but after seeing how you approached it, i've made a few adjustments and think i've got it now.

If you want to have a look i've attached the prefab, you have to drag the End object to move it around in the scene view, but you can drag it near to Connection A or B and it snaps to the object using the vector3 position (if the Tag is correct on the trigger).

Thanks for all your help, I'll be able to load this into my hololens project now and see if I can connect everything together with it!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: Need a little help
« Reply #8 on: August 02, 2017, 09:42:40 AM »
Hi,
Nice! i will check it out this week (to much work atm)

XL2c

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Need a little help
« Reply #9 on: November 12, 2017, 07:17:50 AM »
Hi JLawton,

I can see that you are using playmaker with a hololens, and in the screenshot you provided you seem to have managed to implement air-tap action, would you care to share your actions with us?

Best regards

JLawton

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Need a little help
« Reply #10 on: November 15, 2017, 02:46:11 AM »

I used the Playmaker Mixed Reality asset from the asset store. Works very well

https://www.assetstore.unity3d.com/en/#!/content/90811