playMaker

Author Topic: Create a collider on a new gameObject...  (Read 1205 times)

jbaldwin

  • Playmaker Newbie
  • *
  • Posts: 2
Create a collider on a new gameObject...
« on: May 16, 2017, 02:09:33 PM »
In game, if you click, then drag, then let go, a line will be made at the angle of where you started to where in let go. I would like to add a collider to this line (bar) that is tight to the new object.

Right now a collider is created on the line when the line is created, but it's not the right size at all.

I hope I am explaining myself right, does anyone have any thoughts or tips on this?

Thank you.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Create a collider on a new gameObject...
« Reply #1 on: May 17, 2017, 04:08:31 AM »
Hi,

 you should be able to control the size of the collider you attached. have you tried this? you can use SetProperty for this.

 Bye,

 Jean

jbaldwin

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Create a collider on a new gameObject...
« Reply #2 on: May 17, 2017, 11:21:35 AM »
Hi Jean,

Thanks for the quick reply. So after some fiddling, I think I know the problem a bit better. I am using the action Draw Line from the EcoSystem(I think you made the action). When the line is drawn, it's without a sprite, making the added collider unable to match its boundaries. My big issue is that the lines can be drawn at any angle (by intention). If I could get a sprite to match the boundaries, position, and angle of the texture "whatever it is", I would just have to add a collider after that.

Any thoughts? I feel like I am missing something.
« Last Edit: May 17, 2017, 11:50:51 AM by jbaldwin »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Create a collider on a new gameObject...
« Reply #3 on: May 23, 2017, 04:29:30 AM »
Hi,

 ouch, I see this is going to be tricky indeed. You should use a framework for this like:

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

let me know how this goes, indeed you may need to create custom actions though.

 Bye,

 Jean