Jump to content

Coloring a vessel part


Recommended Posts

How can I simply add color on top of a part's texture? I'm trying to adapt this:

http://kerbalspaceprogram.com/forum/showthread.php/17611-Re-entry-Heating-Model

and add a heating visual effect.

I am attempting to expose myself to how to code in KSP, but there's little documentation. I was thinking about looking at the Unity documentation, but before I do that, could anyone help me?

Link to comment
Share on other sites

  • 3 weeks later...

You could look at how ORDA does part-highlighting when you pick target docking couplers.

Actually, I'll look it up and report back.

EDIT: I bet it leverages lots of bits of the unity engine, so I'll trace it back until it defines what color to highlight it and I bet that's what you'll want to use!

EDIT 2: Found it . . .

from orda "vesselDockingPort.highlight(Color.green);"

That's what turns the parts green. To define your own color make a Color var like so

var color : Color = Color(0.1, 0.2, 0.3, 0.4)

In the above the arguments are Color(red,green,blue,alpha)

So what I'd do is however often you're updating the color, define a new one and then apply it to the part with

MyHotPart.highlight(Color.color);

DISCLAIMER: I have never written a plugin for Unity or KSP.

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