Jump to content

Parachute part not behaving correctly - solved


Recommended Posts

This post contains the original question, now answered, however I came across a new issues that I describe in the 7th post.

--------------------------------------------------------------------------

I'm having my first crack at making parts for KSP as well as using Unity (far from my first games assets though... that's the day job, but currently using UE4) and I'm having an issue with the installation of PartTools.

I'm following the guide on making KSP parts here and at Step 5 "Setting up Unity" is where I've hit my snag.

I downloaded the latest version of the PartTools package from this thread and imported it into Unity. I can see installed folders and files under Assets in the Project tab, but according to the guide I'm following, I should also see a PartTools window with "a button called "Set Data Dir". Unfortunately I'm not seeing that window.

Is this something that is now out of date in the guide I'm working from? If it is, how should I set GameData as my Unity Data Directory?

In case it helps, here's a screenshot of my install of the Unity editor.

D7DC9DP.jpg

There is an error in the log about duplicate DLL's for one that comes with Visual Studio. I'm guessing that's not related to this issue,

 

Edited by purpleivan
Link to comment
Share on other sites

You won't see the "Set" button until you add PartTools to your root GameObject. Then when you select that GameObject a "PartTools (Script)" pane will appear in the inspector that will contain a "File URL" label, a empty textbox and a "Set" button among other things. Pressing the set button brings up a dialog where you can set your game directory. Welcome to the often frustrating world of KSP modding!

Edited by wasml
Link to comment
Share on other sites

10 hours ago, wasml said:

You won't see the "Set" button until you add PartTools to your root GameObject. Then when you select that GameObject a "PartTools (Script)" pane will appear in the inspector that will contain a "File URL" label, a empty textbox and a "Set" button among other things. Pressing the set button brings up a dialog where you can set your game directory. Welcome to the often frustrating world of KSP modding!

Thanks for the info.

When you say "File URL label" is this the "File Path" text field... can't see one for File URL?

I can't see a Set button in the PartTools tab.

Here's what I see after adding PartTools to my root GameObject using the Add Component button.

OhaO9GB.jpg

BTW... do you know anything about animation import into Unity. I'm trying to get the rigid body animation of my parachute (a few scale animation keys) imported, but so far without success. Unity import picks up on the FBX file as containing an animation , but the animation doesn't seem to play in Unity (hitting the scene play button or scrubbing the slider in the animation tab for the animated object).

Link to comment
Share on other sites

7 hours ago, purpleivan said:

do you know anything about animation import into Unity

When I import animations the first thing I do is remove the Animator component and replace it with the Animation component. Then at the top of the inspector just under the tag and layer buttons - to the right of the Model label - I hit the select button and then the Rig button and change the animation type to legacy. Then I click the "Animations" button that's beside the "Rig" button and name the animation. At this point I go back to the Animation component that I added and uncheck "Play Automatically" and then set the animation to my animation. At this point I open the Animation window and make sure it works as expected. If I open Window | Animation before this is setup Unity doen't think there's any animation.

Edit: It looks like the Animation window only sees the animation if you have the object with the Animator component selected.

Edited by wasml
Link to comment
Share on other sites

2 hours ago, wasml said:

When I import animations the first thing I do is remove the Animator component and replace it with the Animation component. Then at the top of the inspector just under the tag and layer buttons - to the right of the Model label - I hit the select button and then the Rig button and change the animation type to legacy. Then I click the "Animations" button that's beside the "Rig" button and name the animation. At this point I go back to the Animation component that I added and uncheck "Play Automatically" and then set the animation to my animation. At this point I open the Animation window and make sure it works as expected. If I open Window | Animation before this is setup Unity doen't think there's any animation.

Edit: It looks like the Animation window only sees the animation if you have the object with the Animator component selected.

Thanks for the suggestion... I'll check what you've suggested tomorrow.

Link to comment
Share on other sites

@wasml I made the changes you suggested to the animation setup of the parachute in Unity, but I'm experiencing some issues with the animation and parachute behaviour in-game.

Issue 1. When the parachute part is staged it deploys upward, unaffected by the upward movement of the vehicle, into the semideployed state. At the end of the animation, it pops to being dragged behind the vehicle.

Issue 2. Once it has fallen to the altitude for the fullydeployed state, the correct animation for this plays, but slowly, probably about 1/3 of original animation speed.

Issue 3. Even though the CFG file for the new part is a duplicate of a stock one, with only the entries for Name and Title changed (i.e. nothing that affects it's functionality), the parachute appears to have no drag and the vehicle crashes into the ground.

Here's a video of what happens when staged.

Here's the setup of the animation of the part in Unity. The entry in the field Animation is set to Non (Animation Clip) which seems a little wrong, but changing it via the small circle selector next to it, to one of the alternatives (semiDeployedSmall) gives the same problematic behaviour in-game.

BzjL6sy.jpg

Any advice you have on this would be well appreciated.

Link to comment
Share on other sites

I notice that while the canopy Z axis appears to be in the correct direction - it's rotated with respect to the global axis - looks like the canopy's up is in the global Y direction. I'd try removing the canopy X rotation. Blender has everything rotated 90 degrees on the X axis when you import to Unity - one of the first things I do is zero that rotation. This will probably involve changing your model in Blender (assuming you're using Blender).

I'm at a loss for why the animation is running at reduced speed.

I've seen the no drag problem before but don't recall what I did to fix it - when I last made a parachute I gave it custom drag cubes and I have a dim memory of tweaking the ModuleDragModifier parameters - mine are much higher than the stock values (4 and 30).

I made and shared some template parts - includes Blender and Unity projects with notes. If you do solve the animation speed and drag problem I'd be interested in the solution - I'll add to the notes in this project (and any feedback on any of the parts would be welcome).

 

Link to comment
Share on other sites

I am now getting somewhere at last @wasml as I now have the parachute deploying and animating correctly, with a couple of minor caveats.

Everything is fine, except that at the point when switching between the animated states (semi deploying and fully deploying) and the unanimated states (semi and fully deployed) the entire canopy is instantly rotated around its vertical axis by 180 degrees. I wouldn't have noticed except that I'd put a big black square on one side of its texture, to allow me to compare orientation of the object in Max and Unity.

At the same time as the 180 degree rotation occurs, there's also a small clitch in orientation between the end of animated and beginning of unanimated states. I might try exporting without animation compression to see if that's the issue, although I doubt it.

BTW... my solution, after many attempts at changing the rotation within the object of the vertices and of the object itself, seems to be no different than where I started. So I'm guessing that there was something else that I was screwing up. One thing I did notice is that my working version has a different orientation in the animation player in Unity than your example. Whereas your example chute sticks out to the side, mine is orientated verticaly upward. But both work in-game... wierd.

But at least it.s progress :)

One more thing, the slow speed of the fully deploy animation is due to a setting in the CFG (deploymentSpeed) which is set to 0.12 whereas the one for semi deploy is 0.5

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