I must admit that I feel stupid for not having realized this earlier but I was updating / dual using Unity 3.5 and 4.0 as well when this happened, so I was a little unsure what was causing it, but here goes: If you access your Unity project on a network share (like: \\server\project\game) then [...]
I updated the version of the Speeder with the CarSmoothFollow Script from the Unity Wiki. I also added detachable spoilers via the Hinge Joints (setting the Limits very narrow so that they don’t move by themselves). The Fixed Joints seemed a good idea at first but they wouldn’t keep still. So to prevent the spoilers [...]
My current findings for setting up a car rig have been the following: As we usually deal with several wheels I use arrays to store everything. This lets me add more wheels without breaking into a sweat or having to go copy-paste all over the place. The base vehicle Axis contains four wheel axis objects [...]
I’ve experimented with an offroad vehicle, based on the experiences gained with the truck. The basic setup wasn’t too difficult and even jumping and speeding over the rough terrain was pretty nice, but trying to point the car in the right direction or even getting it through the poles grew into quite a challenge because [...]
Had another go at the WheelCollider, as I wasn’t convinced that completely custom built vehicle physics would save that much time, and I have made a couple of improvements. Most of all the Suspension is now correct, as I was doing it wrong most of the time: The best way to start is to set [...]
I experimented a little with the Unity physics and wheel collider features to try to get a working truck + trailer configuration working for rough terrain. As I had already done some truck and trailer physics for a farm simulator at work I wasn’t expecting this to be that tricky. I uploaded my current state [...]
iTween must be one of the single most usefull scripts that are available. There is just one thing that makes working with it slightly obscure, because of the way extended options have to be added via the hash table by using the iTween.Hash() function. iTween.MoveTo(exhibitObject, iTween.Hash( “position”, presenterTransform.position, “time”, reloadDelay, “islocal”, false, “easetype”, iTween.EaseType.easeOutQuad ));
February 25, 2012 – 23:28
A nice script for creating a real time cubemap from an object position for use with a reflection shader to create realtime reflections in Unity. Converted from the JavaScript example. Note: This script requires the Unity Pro license. using UnityEngine; using System.Collections; public class RealtimeCubemap : MonoBehaviour { public int cubemapSize = 128; [...]
Something small but usefull is the String.Format function, with which you can format your numerical outputs: using System; using System.Collections; … // formatted float with three zero padded digits // in front of the “.” and three digits after it. debugText += String.Format(“H{0:000.000}\n”, heading); // formatted int with formats for positive;negative;zero values debugText += String.Format(“S{0:+000;-000; [...]
Here’s something that will calculate where two lines will intersect. If they don’t intersect then the two resulting vectors will mark the points where both lines are closest together. /* setup vectors */ Vector3 l1begin = playerCurrentPosition; Vector3 l1end = playerTargetPosition – l1begin; Vector3 l2begin = enemyCurrentPosition; Vector3 l2end = enemyTargetPosition – l2begin; /* calculate [...]