Everything was fine till all gameObjects stoped to see pivots from their sprites
in sprite they have pivot in the bottom, and gameObject has sprite sort point set to pivot, but all they show and act as pivot is in the center
[gameObject]
[sprite]
Why could this happen and how to fix it?
I have tryed create gameObjects again and reasign pivot, also reimported sprite file, but nothing changed
It seems like tool handle position is set to center. You can change it from the top left part of the scene view from center to pivot.
I have found couse of problem - it was render settings, after shifting to new pipeline assets render my setting for transparency sort mode was changed, I set them againg and it works as it was
Related
I'm making a main menu for my Android game and I ran into this bug I suppose which I can't seem to resolve.
I made the options button reveal a rect transform that shows sliders for volume control and buttons for right or left shooting button placement.
The UI buttons seem to work fine, but the sliders won't slide. If I place the sliders outside of the game object with the rect transform mask it works, and if for example during the editor play test I copy the slider inside the game object the copy also works, but then for example if I take a slider that was outside of the game object and put it under the game object during the play test it again won't work.
Has any of you encountered this issue? How can you work around that so I maintain the revealing-window effect? Thanks.
EDIT: I fixed it by resetting the scale values of the rect transform of the holding game object to 1. It was set to 117 while the width and height were set to values 117 times smaller than they would have otherwise. I don't know why it messes with hoe the touch is read for the sliders, but it was resolved after scaling it down to 1 and adjusting the rect width and height and the UI objects' scale back.
Did you find out why this was happening? I'm having the same issue here.
I had a canvas with a scroll bar working normally, I needed to set the canvas render mode to "Screen Space - Camera", and now the bar doesn't move anymore.
When you change the Canva's Render Mode from Screen Space - Overlay to Screen Space - Camera, an new slot called Render Camera will appear under the Canvas. Drag your main camera into this slot. That camera will be used to send events to the UI elements.
If you've already done this but the problem is still there, delete the ScrollRect and create a new one. Finally, if the ScrollRect is still not moving, make sure that no other UI object is blocking it.
Maybe a hidden panel or image with 0 alpha... Any UI object that is below the ScrollRect in the Hierarchy tab will block the ScrollRect if on top of it.
EDIT:
Once you drag the main camera to the Render Camera slot, Plane Distance slot will appear. Also make sure that it's not set to 0. Mine is set to 100 as shown in the screenshot above and that should work fine.
There might be multiple reasons why your scrollview doesn't work
I encountered with a similar problem. My canvas had a background image so i had to put a Image element without a sprite and set the alpha to "0" within Content of scrollview.
when your viewport field is not referring to viewport object in scroll rect
Try altering the movement type
I also had this problem due to not having an EventSystem in the scene.
I've got a scene for a dynamic menu, where I'm trying to make the camera move between the canvases (menu entities in this case) when a button is pressed. How can I make it move to another canvas space using four canvas corners so the camera's field of view can attach itself to these four corners. P.S. I'me pretty new to Unity, don't be too judgy.
Something like this plan.
Menu Layout
Thanks in advance!
As far I have understood, you can set the Canvas Render Mode to World Space from the inspector.
Then you can position the Canvas position as your wish.
Please see the attached images.
Look my game has a fixed camera, configured as a standard 1280x720.
I placed at each end of the cam width of an empty object with a collider to prevent the player pass this point.
Everything works perfectly until the default resolution decreases. When I run the test with 480x320 screen width decreases, but the collider, does not follow this decrease, staying out of the screen, which makes the player to be "cut off."
The following two images:
First: 1280x720
Second: 480x320
There is some way which I can only set the side margins left and right of the camera as a collider?
If it is not possible to configure only the edge of the camera as a delimiter, the player would have some other way to do something to solve my problem?
Some items fall from the sky, so I can not have a collider at the top of the camera.
There are many ways to do this. The easiest way is to create a 4 box collider 2D and position them to the edge of the screen.
I always use this complete script to do this. It's too long to post here. Just attach it to an empty GameObject in the scene. It will do the rest of the work for you. I will create the colliders and position them to the edge of the scrren automatically.
As what i have understand my be this can help you
Scale box collider to camera view
I am developing a game with Unity which has a main menu to allow the user select game mode. In this screenshot you can see an example:
My problem is the following:
I need to create a scroll in which user can put his finger on point 1 and swipe/slide to point 2. On the one hand, while this action is happening the element 2 increase its opacity and its position change progressively to the center. On the other hand, while this action is happening the element 1 decrease its opacity and its position change progressively to the left part of the screen.
Extra information:
The elements are sprites with colliders to detect the selection of the player.
What would you suggest me to do? Have you got any code to solve this? Any other suggestion?
Hey i think i understood your problem,
According to my understanding. You can use a binary tree for this work, u can use a sprite sheet with different level of alpha value. The variable of the binary tree responsible for changing the sprite will depend on the finger's position on the screen which you can easily get by camera.ScreenToWorldPoint(pos). also you can easily change the position of the gameObject by recording the change in initial and final position of the touchPhase.