Hi Everyone,
One of the things that always annoyed me about UDK was the absence of a decent road tool. Of course, we do have spline lofts but their default settings make them seem glitchy and unusable, and worse, they have no collision. So even if you get them to laid out in your scene, when you try and run on them you just fall through them
So two issues there:
1. unglitching them - turns out there's a couple simple tweaks to their settings that sort them out (once you've figured out why they were going mental)
2. no collision! - for this I had to learn a bit of unrealscripting (big shout out to FTC for his fantastic tutes on working with splineLoftActors)
Here's a video explaining the above and showing my custom splineLoftActor working with collision (p.s. I'm cloning the spline nodes by holding Alt when I move them) :
And here are the scripts (if you don't know where to put these you need to go and find a tute on the basics of using custom scripts in UDK) :
splineActor_collidable.uc
colliderMesh.uc
One of the things that always annoyed me about UDK was the absence of a decent road tool. Of course, we do have spline lofts but their default settings make them seem glitchy and unusable, and worse, they have no collision. So even if you get them to laid out in your scene, when you try and run on them you just fall through them

So two issues there:
1. unglitching them - turns out there's a couple simple tweaks to their settings that sort them out (once you've figured out why they were going mental)
2. no collision! - for this I had to learn a bit of unrealscripting (big shout out to FTC for his fantastic tutes on working with splineLoftActors)
Here's a video explaining the above and showing my custom splineLoftActor working with collision (p.s. I'm cloning the spline nodes by holding Alt when I move them) :
And here are the scripts (if you don't know where to put these you need to go and find a tute on the basics of using custom scripts in UDK) :
splineActor_collidable.uc
Code:
class splineActor_collidable extends SplineLoftActor; var array<colliderMesh> colliders; var vector loc,rot; var () Vector collisionScale; var () int collisionSpacing; event PostBeginPlay() { local float splineLength; local int i; splineLength = self.Connections[0].SplineComponent.GetSplineLength(); for(i=0; i<splineLength; i+=collisionSpacing) { loc = Connections[0].SplineComponent.GetLocationAtDistanceAlongSpline( i); rot = Connections[0].SplineComponent.GetTangentAtDistanceAlongSpline(i ); spawnColliderInstance(loc,rot,collisionScale); } } function spawnColliderInstance(Vector argLocation, Vector argRotation, Vector argScale) { local colliderMesh spawnedCollider; local staticMeshComponent spawnedColliderMeshCompononent; spawnedCollider = Spawn(class'colliderMesh', self, , argLocation, Rotator(argRotation),,true); spawnedCollider.setDrawScale3D(argScale); spawnedColliderMeshCompononent = new () class'StaticMeshComponent'; if(spawnedColliderMeshCompononent != None) { spawnedCollider.AttachComponent(spawnedColliderMeshCompononent); } } defaultproperties { }
Code:
class colliderMesh extends StaticMeshActor placeable; DefaultProperties { bCollideActors=true bBlockActors=true Begin Object Class=StaticMeshComponent Name=TouchProxy StaticMesh=StaticMesh'UN_SimpleMeshes.TexPropCube_Dup' BlockNonZeroExtent=true BlockZeroExtent=false BlockActors=true HiddenGame=true Translation=(X=0.0,Y=0.0,Z=0.0) CollideActors=true Scale3D=(X=1,Y=1,Z=1) End Object CollisionComponent=TouchProxy Components.Add(TouchProxy) DrawScale = 1 bNoDelete = false bStatic = false bMovable = true }
Comment