Jump to content

Animation . . . complete failure


Recommended Posts

I animated my part in Blender, exported it to Unity, then wrote it to KSP. I've checked my setting against a tutorial and it looks correct. The animation isn't showing up in KSP at all though. The right click menu isn't showing either and I can't even click on my part when I'm in action group mode. Finally, my engine seems to be running in the SPH and occasionally throws sparks.

Any idea what the heck I just did?

Oh, If I tell Unity not to import the animation, then write out again, then re-edit the .cfg to remove the animation bit, everything is back to normal.

Link to comment
Share on other sites

which type animation is this? The Engine heat emissive? Engine throttle response animation? some generic animation? landing gear? animated lights?

are multiple animations trying to move the same transform?

unselectable part could be missing collision mesh; parts with no collision mesh will be unselectable once placed in the Editor.

need a little more info on what you are trying to do.

Link to comment
Share on other sites

Does the animation show in Unity? Also did you export it as FBX?

Yes and yes.

which type animation is this? The Engine heat emissive? Engine throttle response animation? some generic animation? landing gear? animated lights?

are multiple animations trying to move the same transform?

unselectable part could be missing collision mesh; parts with no collision mesh will be unselectable once placed in the Editor.

need a little more info on what you are trying to do.

It's a generic animation named "rotation". The .cfg entry was:

MODULE{
name = ModuleAnimateGeneric
animationName = rotation
startEventGUIName = Switch to Vertical
endEventGUIName = Switch to Horizontal
//actionGUIName = Toggle Direction
}

It's a single animation that rotates the part 90 degrees. It definitely has a collision mesh.

Link to comment
Share on other sites

Hi, Depending on the version of unity you use you may have to set the animation type as legacy in the inspector window, as default it's set to generic, newer 4.2 on versions dont support imported animations the way the older versions did.

Setting is done at import as shown in image below

That's how I have mine set.

Link to comment
Share on other sites

like spanner mentioned. definitely check your rig setting first. should be Legacy. For transform rotation any current Unity version is alright. make sure you are using "Animation" component; not "Animator" component. Unity will set the correct component based on the rig setting. click "Reimport" after you've changed the rig setting just to be safe.

this line determines what the action is named in Action Groups; probably why it's not visible because it's commented out in the Animation Module.

actionGUIName = Toggle Direction

do you have other Animation Modules on the same part? AnimateHeat/AnimateThrottle/AnimateGeneric don't play nice together for whatever reason, safest to use only one of them on a part, especially if bits on the part is affected by multiple animation clips. Test each animation clip to make sure they work alone, then add other animation modules and see what breaks.

Edited by nli2work
Link to comment
Share on other sites

like spanner mentioned. definitely check your rig setting first. should be Legacy. For transform rotation any current Unity version is alright. make sure you are using "Animation" component; not "Animator" component. Unity will set the correct component based on the rig setting. click "Reimport" after you've changed the rig setting just to be safe.

this line determines what the action is named in Action Groups; probably why it's not visible because it's commented out in the Animation Module.

actionGUIName = Toggle Direction

do you have other Animation Modules on the same part? AnimateHeat/AnimateThrottle/AnimateGeneric don't play nice together for whatever reason, safest to use only one of them on a part, especially if bits on the part is affected by multiple animation clips.

I definitely have it set as "Legacy". I'm using the animation component, not animator. I changed the part.cfg so the only MODULE is the animateGeneric and I removed the comment slashes on actionGUIName. There are no other animations.

Link to comment
Share on other sites

sorry to sound like I'm repetitive, your reply to spanner went in while I was typing. :D

still no go? is Play Automatically unchecked?

No problem.

I've tried it both ways with no change. KSP acts normally right up until I add the ModuleAnimateGeneric stuff. Anyone have an animated part that works without a plugin so I can just compare what I've got to something that works?

I'm going to restart the Unity project, in case I messed up the part tools or something. This is driving me nuts. The engine worked just fine. Add ModuleAnimateGeneric and everything gets jacked up.

Link to comment
Share on other sites

what does debug window say when you load the part in Editor or when you try to trigger the animation? ALT-F2 brings up debug console. white/orange text is okay; red is bad.

what's your output_log.txt say? it's in KSP_Data folder. Open it up and do a search for the part's name. you will see KSP loading its texture; then model; then config; then compiling the part for Editor. and if there's any error in one of the stages, there would be some info on what caused the error.

here's a part using ModuleAnimateGeneric; if you import this package into an existing project; don't import the Part Tools bits. duplicate part tools in same project makes things funky.

http://www./download/6xzew1ij1vcvu1x/AnimateGenericPart.zip

Edited by nli2work
Link to comment
Share on other sites

NullRefException is kind of vague, just means something is missing, could be anything though.

IndexOutOfRange generally mean a module is not loaded correctly, doesn't say which one. but usually it's the last one in the config file. KSP is trying to access a module at Index 5, for example, when there are only 4 in the array, and throws IndexOutOfRange error.

launch the part, try triggering the animation and see what comes up in Debug window. if a NullRefException comes up when you trigger the animation, it means the animation is not in the MU file. it either didn't export out of unity correctly, or KSP has the wrong MU file.

did you copy the config from another part? if so, check the part = partname line at the very beginning make sure it's not a duplicate.

Edited by nli2work
Link to comment
Share on other sites

IndexOutOfRange generally mean a module is not loaded correctly, doesn't say which one. but usually it's the last one in the config file. KSP is trying to access a module at Index 5, for example, when there are only 4 in the array, and throws IndexOutOfRange error.

Yeah, I've done a little programming. That's what I figured it meant, but why? I might just have to give up on animating parts for now. I might be in over my head.

Link to comment
Share on other sites

send me the unity assets, I can take a look at it maybe figure it out. everything so far looks correct, there's something else that's not right. or post the output_log.txt, there's more info in there you don't see in debug or log.txt.

Link to comment
Share on other sites

hello !

Box Tuto Purpose

this a full example using stock module animation and of course Firespitter (to compare both of them) :wink:

Archive contain full thing, blender model, UNITY file , texture, and The Complete result part Folder

Animation are made directly in UNITY because it's simpliest animations, (compile result less data size in export).

Look Hierarchy in Blender and UNITY, Axis Orientation (important) and Name matching between Cfg and UNITY.

-

(may be need a little tweak on position on part look in cfg attachnode )

For picture look in French Post here start of modding tank think thing lol !

steph

Edited by stephm
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...