How would I activate triggers when clicked

Right now I’m trying to make a small game that’s like Simon, and just click some squares that light up and you click them to score points . This is a game with a top down perspective .

I tried creating a game object that shot projectiles at the squares , but all the scripts ive tried thus far won’t shoot where I click . Instead it sways to the side a bit . This is my first game with unity, any help will be appreciated

Give each block a collider.

Then in an input script (assigned to say some object in the scene, like an empty gameobject you might name “Input Controller” or something), you want to check for mouse button down in the the Update. Input.GetMouseButtonDown(0) will do the trick.

When that happens, get yourself a Ray to cast into the scene. You can get one based on where the user clicked the mouse (or touched the screen) with a convenient method on your Camera ScreenPointToRay(). Pass in the mouse coordinates (see Input).

Then use that ray in a Physics.RayCast() call to see what, if anything in the scene it hit.

Search the docs for any of the above methods for more info.

Thank you so much nsxdavid.
IS their a way to trigger scripts attached to the individual blocks .

Like say if you click the blocks in the wrong order, then the block runs a
Destroy(gameObject) script , along with instantiate a ugly X block .

This is what I have so far

It wont compile, I feel like im close here …

Your game sounds similar to a tutorial walkerBoys has done. You might want to check it out. Go to part 26 of the series to see what the finished game looks like.

http://www.walkerboystudio.com/html/unity_training___free__.html#unity3game1

Roger0
A million thanks, I manly just need the click to activate script, give me a month and I’ll have somthing nice