playMaker

Author Topic: Set Parent action deforming mesh? [SOLVED]  (Read 3151 times)

jalex19

  • Playmaker Newbie
  • *
  • Posts: 27
Set Parent action deforming mesh? [SOLVED]
« on: March 24, 2012, 10:25:40 AM »
I'm prototyping a simple game  similar to Gold Miner: http://www.mofunzone.com/online_games/goldminer.shtml

where you pick up "crates" with a "hook" that rotates at the top of the screen - upon clicking on the hook it shoots down and grabs any crate in its path and brings it back up.

I have an FSM on the crate to look if its been collided with (the hook has a rigid body, crate is just using a box collider), at which point it will use a Set Parent action and make the hook its parent, and retract.

This works for the most part, however if the hook hits it at any kind of oblique angle, the crate's mesh will deform into a rhombus, and I have no idea why. (The more oblique the angle of contact the more severe the deformation) Ideally I would like to rotate the crate to the normal of the hooks surface, but I don't want any mesh deformation!

Anybody have advice? I can provide pictures if needed when I get my website up and running again.

Thanks!
« Last Edit: March 26, 2012, 07:43:12 PM by jalex19 »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Set Parent action deforming mesh?
« Reply #1 on: March 25, 2012, 03:22:00 PM »
Strange! Check the transform of the parent and child objects in the Inspector. Are there any weird numbers in there? Do they change when parenting? If you take screenshots, include the Inspector Transform...

jalex19

  • Playmaker Newbie
  • *
  • Posts: 27
Re: Set Parent action deforming mesh?
« Reply #2 on: March 26, 2012, 07:42:57 PM »
Strange indeed. My hook was a simple cube with the Y scaled to 0.2 to make it more of a rectangle, apparently that scale contributed to the skewing. The Y scale value of the crate went to 4.9 something to compensate, and there was a slight z rotation as well as an x scale adjustment.

However setting the hook up to have a 1,1,1 scale was fine. This shouldn't be a problem going forward as I'll just need to make the asset. It still seems strange that it would react like this however.

Thanks!

SirNikkolas

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Set Parent action deforming mesh? [SOLVED]
« Reply #3 on: March 26, 2012, 08:52:57 PM »
When I had a problem with some of my cubes deforming, I put an emtpy game object between the parent and child. Maybe putting an empty game object between the hook and the cube you're picking up might work. Like an emtpy game object at the top of the hook is the one actually grabbing the boxs, OR the hook is actually grabbing an empty game object attached to the box. Might work.

jalex19

  • Playmaker Newbie
  • *
  • Posts: 27
Re: Set Parent action deforming mesh? [SOLVED]
« Reply #4 on: March 27, 2012, 07:50:46 AM »
Also good advice, leading me to a tangential question, are extra GO's expensive (considering mobile development here) if they are just empty containers? I know they don't cost draw calls/tris, but do they leave a big memory footprint?

In this case I think that's a good idea, but im just wondering in general, how much each one costs me.