MACAUSLOT88 Deposit Pulsa 3 - still needs some tweaking I think, I’d like to be able to spawn cars on the roads, but no idea how to go about it. The particle system doesn’t allow you to create meshes right?
Ha! I think the ultimate goal is to produce a few minimally interactive environments to work almost as music videos. Something to play around with for the few minutes a track lasts without requiring much concentration or skill.
I thought about random buildings, but didn’t know how to script them – I think it’s too late to put something like that in now though.
A car script would be great, thanks! The cars would need to spawn at a distance where they become invisible due to the fog and travel along the road. I’d need a way to vary the speed and number of cars spawned, and I guess an easy way to position them. Would that be easy?
If you’re interested in working together for a quick project, I’d like to make something similar to this image:
The guys would be standing instead of walking, all facing the camera. By clicking on a guy you’d see from his POV (and I guess the audio listener would change also), alowing you to move around the scene by jumping from person to person. There are a number of other little things that could be cool to add with a few simple scripts also, the more random and alive the environment can feel, the better.
How to use:
Create an object. It can be an empty and call it start, or whatever you like.
Place it on the point you would like to start from.
Put the Spawner script that object.
The first value of Spawner is an array. Put here as many cars as you like.
They will be selected by random. The car objects should be prefabs.
The second value is the Target Object. Create an empty called target, or whatever you like.
Place it at the point your cars schould be moving to.
The third value is the frequency. If the value is 3, nearly every 3 seconds a car is spawned.
This value is a little randomized, to create different spaces between cars.
The last value, controls the speed the cars are moving.
Take a look at the demo level at the package, it should explain a lot.
Move around the cubes start and target, the direktion of the cubes will be updatet at runtime.
So this is all. If you have any questions just post them here.
Wow, that was fast! Perfect, thanks. Could be worth making a new post for it, I’m sure quite a few people would find it useful.
I’m trying to put it into the scene, but can’t work out how to change the orientation of the cars spawned. At the moment they all seem to point up, and for some reason changing the rotation in max and then resaving doesn’t sem to have any effect on the cars in the scene. Any ideas?
I got arround it by adding a cube in Max and rotating, saving then deleting the cube and saving again. Odd, I guess Unity was deciding that nothing had changed with the rotation alone?
Bigger problem now - for some reason the cars totally kill the framerate! No idea why, I’ve kept them fairly tiny - 70tris. There ought to be no more than 100 or so cars in the scene at any one time…
So i asume all your cars have just one and the same material.
Remove things you dont need on your objects like collider or animation components.
Cars need to be one object, not two or more. (Wheels, Windows, Body etc.
If that is all the case, you can try this:
Put several cars in a row in one file. All with the same Material and texture ( if you have ).
This way you gonna reduce the drawcalls, created by the cars.
For example, if you put 3 cars in a row in MAX. This should reduce the drawcalls produced by the cars 3 times.
Car drawcalls / 3
At the moment the cars are super simple - yes, just one mesh and one material, (the same material that’s used for every object in the scene)no animation . The drawcalls in the scene peak at 90ish, but that’s all thanks to the clouds. Turn off the clouds and they max at about 20, often much lower, so I don’t think that’s the problem.
The framerate gets lower and lower the longer the scene runs, eventually slowing down to just 2-3fps. I think it can’t purely be down to the quantity of cars being made or their geometry, and must be something else? I wonder if the cars aren’t leaving the scene or something like that at the target?
Edit: I tried with a test scene, with a really high spawn rate. The boxes hit the target and disappear, but the frame rate continues to drop, even after you’d expect it to flatten out. All the other stats (draw calls, tris etc) remain stable.
Going to start on the pyramid/diamond project tonight!
I like this a lot. Your style in this feels like it would mesh well with the project I am working on.
As for the car thing. Do you have a method of destroying the cars when they get out of view? If you keep spawning them, without killing any off, you have to keep track of more and more and more cars.
I was having a similar problem with my dogs in Mind Jacket. Feel free to take a look and let me know if they act like what you’re looking for. I can send you scripts and help set them up if you’d like.
I didn’t, but I tried massively reducing the spawn rate (1 car every ten seconds for the 4 emitters) meaning that there were only 15 cars total in the scene – same slow down as before!
I can however put a block of 1000 cars into the scene next to the camera and it will still run at over 100fps.
So I think it has to be something else. Maybe it has something to do with multiple emitters?
I checked Mind Jacket (oddest game I’ve played for a long time!) and I think the dogs are doing the right thing, however I expect Sunset’s script just needs a little tweaking to get it to go.