Jump to content

Crabsticks

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by Crabsticks

  1. Hi. I'm trying to use triggers in my mod/plugin to detect the parts of a vessel, or even just the vessel, as they move through an area. I've set up the collider I'm using as istriggered and set up my OnTriggerEnter(Collider). Unfortunately it only seems to recognize a few cetain parts (RCS blocks, landing legs and EVAkerbals) but nothing much else. Anyone know how to solve this? I've attempted adding rigidbodies and colliders to all loaded parts in the area but this has had limited success and I have no idea how to set these up so that they don't mess up the physics of the part/vessel, but still get recognized by the trigger. If I can't get this to work I'll give up trying to use triggers and use a calulation based on the position vector of the parts and vessels. I'd appreciate any help or suggestions, Thanks.
  2. Thanks Faark, I goofed; the vessel I was using to test on had the desired part as the root part which explains why the part and vessel position were the same. @Okreeks: I've no experience with Celestial bodies but have you tried the following? CelestialBody planet = vessel.mainBody; planet.gMagnitudeAtCenter = x; planet.CBUpdate (); I have no idea if it'll work
  3. Hi all, As an exercise to learn C# (among other things, eg, modeling & texturing) I've been working on making a working stargate in the evenings while watching stargate . While I've got it mostly figured out and coded I've run into a problem; I have no idea how to get the vector/position of a part. part.transform.localPosition; part.rigidbody.position; part.transform.position; part.localRoot.transform.position; part.GetReferenceTransform().position The above all seem to provide the position of the vessel, not the part. So my puddle jumpers and gate travelers all jump to the centre of the gate ship, not the gate, which causes....problems... So what am I missing? How do I find the position of the part? Thanks in advance. @Okreeks: I might be able to help. Looking at your example code you seem to be creating a new Celestial body but not properly intialising it and giving it a name, so your print statements are correct when they return 0 or Unnamed. Try printing the following, it'll get the name of the celestial body whose SOI your vessle is currently in: vessel.mainBody.name Hope that works and you can work it out from there.
×
×
  • Create New...