Jump to content

The gameObject based 'breakable' system


Recommended Posts

Solar panel destruction used to be config based (isBreakable = true) with a specified gameObject/transform showing which part shears off when damaged, however the latest (23.5) versions of the Squad KSP solar panels no longer have this config line.

I'm not sure when this changed but since I'm making a breakable part right now I'd rather rig it in the 'new' fashion which will presumably be supported rather than a legacy method which may be depreciated and thus require updating at some point later when the method is fully depreciated.

Has anyone rigged a breakable object in this new fashion that could please share how to build the Unity hierarchy for it (gameObjects+components+settings if possible), or could a developer please post a screenshot and/or a brief explanation of the 'new' breakable rigging is implemented.

Thanks for your time,

NMB.

Link to comment
Share on other sites

A lot of times they'll remove config entries if they are using the default name. For instance in an engine the expected name is thrustTransform so you don't have to specify it.

I am guessing this is the case here, and they're just using the default object name, which happens to be sunPivot. You should still be able to over-ride it with the config parameter and name it whatever you like.

Here's a screenshot of solarPanel2 .mu imported into Blender (using taniwha's python script) and expanded - note that the little knob I have selected is below the sunPivot level, and it breaks off on those solar panels.

http://i.imgur.com/11C1SzX.png

Note that Blender didn't really import that in a usable manner, the animation is broken and some of the meshes seem to have lost their.. mesh. But the hierarchy is visible at least.

Link to comment
Share on other sites

OK thanks Tiberion, that's the same sort of hierarchy I'm using for the unfolding animation at least but the panels just don't want to break for some reason, the whole part explodes, or the part it's attached to explodes first and I'd really like it to break into its component panels like the 1x6 and 2x3 solar panels do (at this point I'd temporarily accept the whole thing coming off like the XL). I hope it's not because of Unity not liking the way I rigged it in Blender using empties.

I'll keep working on the sun tracking for now when I get some time, and get back to the breakable bit later, achieve overall functionality first

Link to comment
Share on other sites

I don't know if this will help you any, but it might provide some clues. Here's a dump of how the hierarchy is setup ingame:

[LOG 21:10:10.542] DebugTools, Transform: solarPanels2

[LOG 21:10:10.542] DebugTools, ---> Transform: model

[LOG 21:10:10.543] DebugTools, ------> Transform: solarPanel2

[LOG 21:10:10.543] DebugTools, ---------> Transform: base

[LOG 21:10:10.544] DebugTools, ---------> Transform: door

[LOG 21:10:10.545] DebugTools, ---------> Transform: sunPivot

[LOG 21:10:10.545] DebugTools, ------------> Transform: knob

[LOG 21:10:10.546] DebugTools, ---------------> Transform: panel3

[LOG 21:10:10.546] DebugTools, ------------------> Transform: panel04

[LOG 21:10:10.547] DebugTools, ---------------------> Transform: panel05

[LOG 21:10:10.547] DebugTools, ------------------------> Transform: panel06

[LOG 21:10:10.548] DebugTools, ---------------------------> Transform: panel07

[LOG 21:10:10.549] DebugTools, ------------------------------> Transform: panel08

Note that the Unity hierarchy starts at under "model", i.e. the first child in the Unity hierarchy here would be "base" with a parent that apparently has no collider nor mesh

LOG 21:10:10.506] DebugTools, solarPanels2 has components:

[LOG 21:10:10.506] DebugTools, ...c: UnityEngine.Transform

[LOG 21:10:10.507] DebugTools, ...c: Part

[LOG 21:10:10.508] DebugTools, ...c: ModuleDeployableSolarPanel

[LOG 21:10:10.508] DebugTools, --->model has components:

[LOG 21:10:10.509] DebugTools, ......c: UnityEngine.Transform

[LOG 21:10:10.509] DebugTools, ------>solarPanel2 has components:

[LOG 21:10:10.510] DebugTools, .........c: UnityEngine.Transform

[LOG 21:10:10.511] DebugTools, .........c: UnityEngine.Animation

[LOG 21:10:10.511] DebugTools, --------->base has components:

[LOG 21:10:10.512] DebugTools, ............c: UnityEngine.Transform

[LOG 21:10:10.512] DebugTools, ............c: UnityEngine.BoxCollider

[LOG 21:10:10.513] DebugTools, ............c: UnityEngine.MeshFilter

[LOG 21:10:10.514] DebugTools, ............c: UnityEngine.MeshRenderer

[LOG 21:10:10.514] DebugTools, --------->door has components:

[LOG 21:10:10.515] DebugTools, ............c: UnityEngine.Transform

[LOG 21:10:10.516] DebugTools, ............c: UnityEngine.BoxCollider

[LOG 21:10:10.516] DebugTools, ............c: UnityEngine.MeshFilter

[LOG 21:10:10.517] DebugTools, ............c: UnityEngine.MeshRenderer

[LOG 21:10:10.517] DebugTools, --------->sunPivot has components:

[LOG 21:10:10.518] DebugTools, ............c: UnityEngine.Transform

[LOG 21:10:10.519] DebugTools, ------------>knob has components:

[LOG 21:10:10.519] DebugTools, ...............c: UnityEngine.Transform

[LOG 21:10:10.520] DebugTools, ...............c: UnityEngine.MeshFilter

[LOG 21:10:10.521] DebugTools, ...............c: UnityEngine.MeshRenderer

[LOG 21:10:10.521] DebugTools, --------------->panel3 has components:

[LOG 21:10:10.522] DebugTools, ..................c: UnityEngine.Transform

[LOG 21:10:10.522] DebugTools, ..................c: UnityEngine.BoxCollider

[LOG 21:10:10.523] DebugTools, ..................c: UnityEngine.MeshFilter

[LOG 21:10:10.524] DebugTools, ..................c: UnityEngine.MeshRenderer

[LOG 21:10:10.524] DebugTools, ------------------>panel04 has components:

[LOG 21:10:10.525] DebugTools, .....................c: UnityEngine.Transform

[LOG 21:10:10.526] DebugTools, .....................c: UnityEngine.BoxCollider

[LOG 21:10:10.526] DebugTools, .....................c: UnityEngine.MeshFilter

[LOG 21:10:10.527] DebugTools, .....................c: UnityEngine.MeshRenderer

[LOG 21:10:10.528] DebugTools, --------------------->panel05 has components:

[LOG 21:10:10.528] DebugTools, ........................c: UnityEngine.Transform

[LOG 21:10:10.529] DebugTools, ........................c: UnityEngine.BoxCollider

[LOG 21:10:10.529] DebugTools, ........................c: UnityEngine.MeshFilter

[LOG 21:10:10.531] DebugTools, ........................c: UnityEngine.MeshRenderer

[LOG 21:10:10.531] DebugTools, ------------------------>panel06 has components:

[LOG 21:10:10.532] DebugTools, ...........................c: UnityEngine.Transform

[LOG 21:10:10.533] DebugTools, ...........................c: UnityEngine.BoxCollider

[LOG 21:10:10.533] DebugTools, ...........................c: UnityEngine.MeshFilter

[LOG 21:10:10.534] DebugTools, ...........................c: UnityEngine.MeshRenderer

[LOG 21:10:10.535] DebugTools, --------------------------->panel07 has components:

[LOG 21:10:10.535] DebugTools, ..............................c: UnityEngine.Transform

[LOG 21:10:10.536] DebugTools, ..............................c: UnityEngine.BoxCollider

[LOG 21:10:10.537] DebugTools, ..............................c: UnityEngine.MeshFilter

[LOG 21:10:10.537] DebugTools, ..............................c: UnityEngine.MeshRenderer

[LOG 21:10:10.538] DebugTools, ------------------------------>panel08 has components:

[LOG 21:10:10.539] DebugTools, .................................c: UnityEngine.Transform

[LOG 21:10:10.539] DebugTools, .................................c: UnityEngine.BoxCollider

[LOG 21:10:10.540] DebugTools, .................................c: UnityEngine.MeshFilter

[LOG 21:10:10.541] DebugTools, .................................c: UnityEngine.MeshRenderer

Good luck

Link to comment
Share on other sites

Thanks xEvilReeperx, still not having any luck so the v1 of the panels just might not pivot, more likely something is just set wrong and I'm due for a /facepalm when I see it

I can't see the suncatcher (object? transform?) in that list either, unless they are also not in use any more and it's a layer or trigger option (kind of like airlocks/ladders) now?

Link to comment
Share on other sites

Hi I've just made an animated suntracking emergency solar panel and it still uses the suncatcher, what I did notice though was that the parts have to be the default names or it just doesn't work, here's a shot of it folded up in unity base, solar pivot and suncatcher have to be parented through the animation, The scenes piston to object 02 are the animated parts of the leg that hold the panel , the two pivots not a child of base are just the closing cap halfs. This little fellow animates and sun tracks fine. and snap off if you treat it badly.

ZqEGOX4.png

Link to comment
Share on other sites

still uses the suncatcher

Hrm, you're using solarPivot but the report from the solarPanels2 shows sunPivot, oh well, try both I guess

As for the suncatcher, is that a Unity object (like a plane) with no mesh renderer or just an empty gameObject, how is it positioned?

[Edit] Well it all moves now, except now the animation plays as soon as you pull the part out in the VAB /headscratch (resolved)

Works fine as soon as you launch, i.e. starts closed and opens/shuts properly

Edited by NoMrBond
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...