I've been trying to figure out how to use the RTS plugin from the unity Asset Store but there seems to be a problem. I have no idea why this is happening, but the z and y values are mixed up. I can scroll left and right perfectly but whenever I press "W" the screen zooms out instead of moving upwards. The same applies to scrolling. When I scroll, the screen moves upwards/downwards and doesn't zoom out like its supposed too. I tried creating my own RTS camera via Brackeys and the same thing happened. His game would zoom, mine would just move upwards. I'm not for sure whats wrong. Im fairly new to all this unity jazz. ANY help would be appreciated
it's a little hard to know exactly why this is with the information you have provided. But if I were you the first thing I would check is your input manager! Have you done that and made sure your inputs correlate to exactly what you want?
It's sounds like your settings may be not be the default, causing the differences?
Related
Basically im developing a 2d pang game style for mobile, where you pop some balls. So i created some walls colliders, but everytime i change the resolution, the left and right walls just dont stick to the right place, or they move out of screen or they move in the screen depending on the resolution. I used them to act as boundaries for the bouncing balls. I have struggle with some many scripts, to try to fit the objects on the screen but i cant find a solution for this. I found similar issues, but there solutions unfortunatilly didnt work :/
Any ideias?
Thank you for all the help
I believe all you need are Screen.currentResolution and Camera.main.ScreenToWorldPoint(). This could make things easier. You can adjust the borders position and scale to match your screen before runtime or after changing screen resolution. Visit unity document to see more details.
There's a lot of code so I'm not going to put it here. I'm just wondering if anyone has had a similar issue to this and how they solved it.
I'm trying to create a 3d scene in C# using OpenGL and have got lighting working as well as basic primitive models and more complex models. But now I'm trying to texture the walls and I'm getting these weird lines running through the texture. Whenever I move the camera the lines change and glitch around but are always vertical lines.
I have noticed there is a sweetspot for the camera when looking directly at the wall and being at the right distance from it.
The sweetspot
Rotate left - lines appear
Camera at right angle but wrong distance - texture dissapears
I know it's not a lot to go off so I'm not expecting anyone to be able to tell me exactly what to do. I just want to know if anyone knows what these weird results could be. I'm thinking I may need to change some texture parameters but not sure which ones. Is there a clipping parameter or something? Any sort of guidance here would be appreciated
This looks a lot like z-fighting, which is caused by rendering two surfaces at the same depth. Numerical instability will cause some areas to be drawn over others in a changing pattern.
If you can find out which surfaces you're drawing twice and get rid of one of them, then this problem should go away.
I am working with ARCore in Unity and would like to be able to add points to ARCore's boundary plane by touching a point on the screen. Is this possible?
More specifically, I want to be able to touch a point on the screen that I think should be part of ARCore's current plane and have that point be added to the plane's mesh.
I've looked around a bit through their documentation and on stackoverflow and haven't been able to find an answer.
This is not able and there is a grand chance that this will never be able.
Reason:
AR works with 3D reality, so it not a 2D dimension. This said when you click on your screen how the app will know how far you wanna click?
If the app is not recognising the plane it will have difficult to know if your click is for 30cm from the screen or 2m from the screen or 35cm from the screen.
Got the problem? if the app know the distance for sure it can decide by itself if is a plane.
The solution would be "put" fiscally the app in places that you wanna build a plane, like 3 coordinates and crate a plane between then. But this is not in the direction for User Experience with AR, so I expected today that no one will stop to do something like...
I have a problem using HoloLens and Unity 2017.3.0f3. I open a menu (Canvas in World Space) depending on where the user is looking at using the voice commands.
When menu appears it seems stable, but when walking around it, there is a strange point where it starts to shake and it's separated in different colors, like a rainbow. Very shocking. After 2 seconds it stabilize and appears nice, but everytime I return to that point the same thing happens.
It's quite strange as it just only happen when getting into a specific angle like 65ยบ by left (clockwise direction thinking you are at 6 and the object is the center of the circle).
I have improved the general stabilization using SetFocusPointForFrame but anyway it still makes that strange color shake. Also, I tried to reduce FPS to 24 with no results. Quality is set to lowest... I don't know what more I can do. Any help?
To understand better the effect I found this video:
https://youtu.be/QMrx-BU4Hnc?t=6m25s
That final effect is what happens to my hologram, but the color separation is bigger and everything shakes.
Thank you!
EDIT: I tried to record a video using Device Portal but the objects dissapear instead of shaking O_o really weird.
Well, it's not really a fix. But if I use Unity 2017.1.0f and Visual Studio 2015 with UWP SDK 10.0.14393.0 the problem disappears... I'll try to find if it's a Unity problem or a SDK problem, but for the moment this is a valid solution to avoid the terrible shake with color separation.
Hope this helps someone! :)
In this game im trying to create, players are going to be able to go in all directions
I added one single image(1024x768 2d texture) as background, or terrain.
Now, when player moves around I want to display some stuff.
For example, lets say a lamp, when player moves enough, he will see lamp. if he goes back, lamp will disappear because it wont be anymore in screen
If Im unclear, think about mario. when you go further, coin-boxes will appear, if you go back they will disappear. but background will always stay same
I thought if I spawn ALL my sprites at screen, but in positions like 1599, 1422 it will be invisible because screen is only 1024x768, and when player moves, I will set place of that sprite to 1599-1,1422-1 and so. Is it a good way to do this ?
Are there better ways?
There are two ways you can achieve this result.
Keep player and camera stationary, move everything else.
Keep everything stationary except the player and the camera.
It sounds like you are trying to implement the first option. This is a fine solution, but it can become complicated quickly as the number of items grows. If you use a tile system, this can become much easier to manage. I recommend you look into using a tile engine of some sort. There are a lot of great tile map editors as well.
Some resources for using Tiles:
Tiled -- Nice Map Editor
TiledLib -- XNA Library for using Tiled Maps
What you're describing there is a Viewport, which describes a portion of the 'world' that is currently visible.
You need to define the contents of your 'world' somehow. This can be done with a data structure such as a scene graph, but for the simple 2D environment you're describing, you could probably store objects in an array. You would need to bind your direction keys to change the coordinates of the viewport (and your character if you want them to stay centered).
It's a good idea to only draw objects that are currently visible. Without knowing which languages or packages you are using it's difficult to comment on that.
I would look into Parallax scrolling. Here is an example of it in action.
If this is what you require, then here is a tutorial with source code.
XNA Parallax Scrolling
After you are finished with basic scrolling, try to implement some frustum culling. That is only draw objects which are actually visible on the screen and avoid unnecessary drawing of stuff that cannot be seen anyway.
I would prefer solution number 2 (move player and camera) - It would be easier for me, but maybe its just personal preference.