Particles as objects?

I am thinking of a game concept where the graphics are all particle effects, would it be possible to make all of the objects (player, bullets, enemies) particles? Couldn’t I just make a bunch of cubes, make them move/react how I want, add the particles, and then turn of the cubes mesh render? Also, where I can find a good tutorial on making particles and finding particle effects that are already made?
Thanks.

Hello Tofudude, this sounds like an interesting idea :slight_smile: yeah it should work to just attach the particle object to the cube and switch off the cube renderer. If you start a new project, and choose to download Standard Assets into it, then you’ll have access to a couple of particle effects and scripts that are needed for them to work properly. You could also look into page 23 in this tutorial to learn how to create a particle system, which I recommend you do : http://download.unity3d.com/support/resources/files/3DPlatformTutorial.pdf

As for collision, take a look in this thread, it might be something more efficient (?)
http://answers.unity3d.com/questions/16210/particle-colission

Hope that helped
/Kweiko

Thanks for the tips:)
I was able to make a cube move, attached a particle system and turned of the cube’s render and it looks cool for just messing around, but it created a problem, sight. When the player character starts moving, the particles trail behind, and eventually you cant see the thing you are controlling, anyone have any ideas?

http://www.shockwave.com/gamelanding/megapixel.jsp

Turn off “simulate in world space”.

–Eric

Thanks for your help. Although after I did that, I decided that the streaks looked cool, so i added a small spot light with a halo, so I have the trail and the game is playable. Although I will probably turn of the “simulate in world space” for the other objects (it might get kind of distracting). I have a few more questions regarding this game idea.

1: When I click somewhat on the screen, what is a script to make something move from an object to the spot where I clicked?
2: Can an audio listener react to things and have that translated into a script (like a music visualizer)?
3: Can I use a script to trigger a change in the color of a particle effect?

4: and what would I have to do to this script to edits its speed?

using UnityEngine;
using System.Collections;

public class Follow : MonoBehaviour
{
    public Transform playerPos;
    Vector3 chaseVel, chaseDir, chasPos;

    void Start() { chaseVel = new Vector3(3f, 0f, 3f); }

    void LateUpdate()
    {
        chaseDir = playerPos.position - transform.position;
        Vector3 tmpNormalizedDir = Vector3.Normalize(chaseDir);
        chaseDir = new Vector3(tmpNormalizedDir.x * chaseVel.x, tmpNormalizedDir.y * chaseVel.y, tmpNormalizedDir.z * chaseVel.z);
        chaseDir *= Time.deltaTime;
        this.transform.position += chaseDir;
    }
}

Thanks (yeah I, do have alot of questions:face_with_spiral_eyes::face_with_spiral_eyes::face_with_spiral_eyes:)

It’s difficult to tell you right away what to do, partly because these kinds of questions needs testing and the solution differs from case to case. But regarding 1: you need a function which “listens” to your mouse clicks, for example OnMouseClick() (I’m not sure if that’s correct, check the script reference). Whenever you click on the screen, this will be called, and there, grab the mouse position of that click and store it in a variable, say you clicked in x=42, y=524 - then you need a Vector2, call it currentMousePos, that stores these numbers. Then just change the wanted object’s position to currentMousePos.

2: I’m not sure what you mean. A script is a bunch of code, so you want audio to become code??

3: You can use a trigger to trigger a change in the color of a particle effect. Place a geometric object (sphere/box/plane/whatever) with a collider and mark that collider as a trigger. This will make the physics engine totally ignore the object, but it will act as a trigger. On that object, add a script where you call the function:

Alt. 1

void OnTriggerEnter(){
 //do something
}

If you want to know what you’re hitting, so that different objects will trigger different behaviour, then use this:

Alt. 2

void OnTriggerEnter(Collider otherObject){
   //check if otherObject's layer/name/tag is equal to what you want
   //then do something
}

4: tweak the x and the z values in chaseVel (which I assume stands for chase velocity).

/Kweiko

Thanks…again. What I meant by the music thing: The audio wouldnt become the code, but the code would be influenced by the audio…if that makes sense? Like a music visualizer, when there is a sudden increase in volume, pitch, etc. then it reacts. So if a song had a sudden loud section like a guitar solo, that would trigger something in the code, is there anyway to do anything resembling that?

And im still a little lost on the “go to mouse” thing, I somewhat understand the process, but how would I to implement the code?

Also, (yeah another broad question) do I add a score and display it somewhere on the screen?

Oh I can’t see any problem with checking the volume or the pitch! My initial idea would be to make a function which checks if the audio.volume is lower or higher than a value and then doing something dependantly on the answer we receive. In the Update() function, just call your function so that the checks are made every frame.

About the mouse, look in this thread, it might help you find the answer: http://forum.unity3d.com/threads/66558-(C-)-Look-at-mouse

To “add a score”, you need a function like “if this happens, then increase the score with 50 points!” or something like that. But remember to declare the score variable outside the function, so that you can store it. Showing a score could be done in multiple ways, but check out Gui Text in the script reference!

/Kweiko

Thank you, but I still dont understand this question:
“When I click somewhat on the screen, what is a script to make something move from an object to the spot where I clicked?”

Can someone please give me a code example? (I dont mean to be lazy, I just dont understand how to put everything together :expressionless: