since floating origin has been added to simple planes the Color trail emitter has been outdated, how do I correctly get the position when the origin updates?
since floating origin has been added to simple planes the Color trail emitter has been outdated, how do I correctly get the position when the origin updates?
@nathanmikeska thanks!
@nathanmikeska I have a repair tool for meshes I could try, if you can send me the script
@Puredeath I looked in to it briefly, trying to use your script, but did not have much luck. I could save a file, but it didn't appear to load properly in Blender or Unity. Unfortunately, I don't have lot of spare time to really dig in to it at the moment, sorry.
@nathanmikeska hey would you be able to help me a bit more with this saving meshes thing? I dont really understand much of this at all...
@nathanmikeska alright thanks, Ill take a look at that
@Puredeath The script i posted should allow you to get the collection of mesh filters that make up the plane. you might need to combine them first in order to run a mesh filter through you export code you found. Might googling or taking a look here on combining meshes.
@nathanmikeska
This is the script I found to save .obj files, im trying to get it to work with the game
' using UnityEngine;
using System.Collections;
using System.IO;
using System.Text;
public class ObjExporter {
} '
@Puredeath Sorry, forgot to mention... the
<
and&rt;
are supposed to be less than and greater than symbols. The markdown syntax on the forum isn't cooperating. I was talking to Andrew about it this morning to see if we can do anything about it.@nathanmikeska so peronally I am not very good at coding, and I am confused on why why MeshRenderer and MeshFilter are not wanting to work, as well as what lt and rt are supposed to be
@nathanmikeska well there are plenty of scripts for saving stuff as .obj files online, I will see if I can get them to work with this. ASAP
I'm not sure how to save it as an obj, but here is a little snippet that I think should give you the mesh objects that make up a visible aircraft.
@nathanmikeska hey I am trying to pull the mesh of the player's plane and its children and save as an .obj do you have any tips, I have found a script but it only works for when in unities editor.
@Puredeath whenever the player gets too far away from the origin, the floating origin script repositions all game objects at the root of the object hierarchy (objects with no transform.parent). It also handles some special case stuff like aircraft rigid bodies, water, and particle systems. The IgnoreFloatingOrigin script can be attached to these top level game objects to prevent the floating origin script from automatically moving them when the world repositions. We use this for a few objects, such as our UI/Hud since it doesn't make since for them to be repositioned.
@nathanmikeska well that sucks, what is this ignore floating origin I am seeing in some scripts?
@Puredeath I am actually not sure how to get Unity's built in trail renderer working with the floating origin. It was a real bummer that I broke that with the floating origin change not long after recording the tutorial video on it. I looked in to it a little bit a while back, but didn't spend much time on it. I seem to recall that Unity's implementation hid a lot of the details from you, and it was not obvious how it could be fixed, if at all. Feel free to investigate, but I suspect you might be better off writing your own custom trail renderer or using one that somebody else has already made.
@nathanmikeska thank you, could you explain how to transform the trailrenderer position based on origin offset? (I am a rather new to unity and csharp)
The IGameWorld interface (accessible via the GameWorld property of your mod's ServiceProvider) has the current floating origin offset ('FloatingOriginOffset' property) as well as an event to subscribe to in order to be notified when the floating origin updates ('FloatingOriginChanged' event).