last day (14 days later) » 

4:30 PM
1
A: What's stopping my camera movement script from receiving input events?

Juan Bayona BerisoI think you are misusing the EventSystem, OnPointerDown, OnDrag and all those functions, they are called when you have a PhysicsRaycaster in your Camera object and you press or drag over an UI Element or and object with a collider. In your code you don't have any of these, you have a camera so y...

 
Thanks for this answer. This is starting to make some sense. Is there a preferred approach between the box collider in a plane or the the bound gui element? I'm thinking that if I go the collider route I might end up with issues once I start populating the plane with other objects, but I don't know for sure.
 
The easiest way of maintaing you code is to create an empy object in a canvas that fills all the screen. Attach your script to that empty element, then make a public variable with your camera object and replace your GetComponent and use this variable instead.
 
Thanks. I've done what I understood from what you suggested and it seems like I still have something misconfigured. Here is my new setup: i.imgur.com/UoFRErz.png i.imgur.com/iyyp3K7.png i.imgur.com/ppERhzl.png i.imgur.com/Pr5UWlx.png Sorry for the screenshots. I can put this in the original post if that is better.
 
Change the blocking mask to everything, also try adding an empty text component to your empty object, although I think that shouldnt be necessary
Also check that your camera has a Physics2DRaycaster
 
Thanks. My camera now has a physics 2d raycaster with the event mask set to everything. No change yet.
 
4:30 PM
Put the blocking mask of your GraphicRaycaster of your canvas to everything too.
 
Thanks, but still no luck. Do I need to add an event system somewhere, possibly?
 
hi, can you read me? Yes you need a EventSystem
 
Hello. Yes, thanks. Does it matter what object I put the event system on? I tried on the camera, the canvas, and the movement script container but either I had it improperly configured or it was not working.
 
Normally it is created automatically when you create the canvas
It normally is its own gameobject
 
I'll put it on the canvas again and if that doesn't work I'll try its own game object. Do I need to do anything for it beyond enabling the standard input module?
 
4:34 PM
Can't you just create a new scene
Select GameObject->Create->UI->Text
attach your script to that text
and see if the calls are getting called?
 
Wow, that did it! My script is receiving events now. Thank you very much. I'll remove the test stuff that might have not been necessary and post the final solution back in the answer.
 
what was it?
 
I added the event system with the default input module back into the canvas after the other changes and now my logs are being hit.
 
the eventsystem?
okay
good luck!
 
Yes. I'm going to remove the text objects and see if it still works. Thank you so much for your help. This is my first unity project and while I'm going through the manual while I learn I still have a lot of fundamental knowledge to gain.
Interestingly enough, if I remove the empty text object it doesn't stops working again.
 
4:38 PM
Ok, I have deleted the comments to not spam the cuestion
 

last day (14 days later) »