Still discussing techies stuff eh?
Yeah, I'm back. If anyone here needs help designing just call me. :)
Still discussing techies stuff eh?
Yeah, I'm back. If anyone here needs help designing just call me. :)
@Xpand: Ok, I figured it out (so easy...) :) Good luck on exams btw :D
Zero: how did you fix your problem?
Substract other rotation from your rotation and you have direction xd I thought of this in school so if it won't work as it should then I have another idea where i'll just check which direction should i rotate in on single axes.
EDIT: Lol, now I've come to a conclusion that it is not the best idea and use something else instead... jezze, programming is f'kin hard but damn I like it xd Can't help it...
Programming and scripting are fun, its just it comes with frustration too! I kind of know what I'm doing, but its slow going sometimes. Just right now I have adapted the AI ship node tracking system to make a vulcan cannon that has a turret that tracks separately to the barrel (think of a tank turret and gun) and it was a eureka moment!
I am trying to think of a solution to your problem, but to be honest the raycast method is the only one I can think of, as it should return the surface normal and aligning to that.
Okay, now I'm stabilizing ship using angle gathered using rays but now I have a problem of this kind: objects rotation is in compartment of 0 - 360 degrees, right? So when rotating my ship forward, for example from 0 to 20 degrees, then there is no problem as I can use Mathf.Lerp to smoothly interpolate rotation of ship to this angle... but if I have to rotate it back from 20 to 330 degrees then this function will interpolate this value from 20 to 330 like this: 22,36,78, and not like this: 20,9,2,359,330... that's the problem :|...
Anyway, programming is going slow as we have a nice weather outside and it's not good to lose it :) And the eeend of schoooool iiiiis coming up....
Why don't you use 20 and -20 degrees?
Also make sure you're using a degree based system. If not multiply the angle by (pi/180) to put it as radians.
Cos localEulerAngles don't come with such possibilities and I have to operate on them... (http://answers.unity3d.com/questions...lerangles.html)Quote:
Why don't you use 20 and -20 degrees?
I'm not sure if this is useful to you:
Within Blender you can use material physics that allow levitation. One side-effect is that ships auto-align while within this field.
I have made a quick example. Press the right cursor key to rotate the 'ship' as it falls...when it hits the field it auto aligns back to normal, automatically. This works for any axis too.
Does Unity do this?
O______________________________O
Nope... I don't think i've seen something like this :<
How about this approach?
http://forum.unity3d.com/threads/316...bject-on-water
Well, I'm using this method (at least simillar) for gravity, yeah, but we were talking about stabilizing ship to be parallel to track if my memory is not wrong xd Anyway, thanks for helping me :)
I know one thing... this is freakin blowing my mind more than problem with random race start enemy positioning, that's for sure •.•
Anyone up to look at this wall of text called script? xd
Attachment 6225
Generally... it works same as simple "transform.one = transform.two" thing... that means I've achieved nothing new xD
I'm trying to see if i can figure out with something on the Unity's physics engine to shift the gravity variable, but it doesn't have anything.
I don't know if it would work, but have you already tried to change the gravity variable? Like dropping it to 1/2 or 7/8 of it's current value?
Edit -> Project -> Physics -> Gravity as (0,-9.81,0) change to anything you need.
EDIT: Thanks to Game programmer from Ubisoft I've figured out how to fix my problem with stabilizing ship on x-axis :D
EDIT2: Or not...
Have you tried using two rays (one front of ship, the other the back) and then taking an average?
I still think linking the ship to a planar surface and then align that surface's normal with the track's surface normal would be easier because you would only need one ray for that and there would be less margin of error...
True, but I saw a problem with this approach in Blender where the alignment would snap to the normal, so unless the track had many polygons making up its topography then you will see the tracking object jolt from one alignment to the next, rather than smoothly interpolating it. One ray would be best from a pure efficiency standpoint, but then getting it working is the first priority.
EDIT> This is not Unity though, so the rules may be different,
But, I understand Zeros pain. You think you have something done, and a minute later it all goes bang. Currently I am trying to create and delete recursive child objects via references. My brain is on fire.....
I'm sure nobody remembers me at this point. But blame school and what not.
Shamar had to draw some art of concept... AGAIN! This time I made sure to take the pictures as soon as I was done. The last one was rushed so...
@Feisar: As for me it looks nice :D Are you going to finish it and add some more details to so it can be made in 3D?
@Aspect: Avarage from rays? My latest beta pf SSGX used about 12th version of this type of solution for alligning and next one is going to use 13th which I'll write... tommorow, yeah, cos I got everything done in school what had to be done, ahahah ^^
@Xpand: I've f***** this method too already xd It worked like potatos used as batteries...
@feisar: Cool! I see bits of Chenghou project in that? Or is it just me?
Yeah I've been busy with exams too... All my recreational activities have crawled to a halt...