• Unity3D - Discussion
    5,004 replies, posted
I have some text on my buttons which are coming from an array but I don't want to put an \n in all of them even though it would be easier. To make it go to the next line when it reaches a certain length or after an amount of word or letter, what would I have to do? Is it explode or...?
Some answers here: [url]http://answers.unity3d.com/questions/39404/guibutton-wordwrap.html[/url]
Thank you. Also my character selection is basically selecting a texture from an array. How would I do to save the texture he picked? I did tried to use PlayerPref but couldn't figure it out, so is there another way of doing it? [editline]1st August 2014[/editline] Any reasons why sometimes the scene doesn't redirect? Most of the time it does but there are a lot of time when it doesn't change the level and I have to close the game. [code] public class RedirectMenu : MonoBehaviour { //Gatherinformation public GUIText loadingText; void Awake() { //Set the view orientation Screen.orientation = ScreenOrientation.Portrait; } void Start() { //Setting the Text loadingText.text = "Loading..."; StartCoroutine(RedirectSeconds()); } IEnumerator RedirectSeconds() { yield return new WaitForSeconds(2); Application.LoadLevel(0); } } [/code]
Does it happen within the editor? If so, check your console. EDIT: Otherwise, if it happens on, say, Android, try hooking it up over ADB or something and watch the output. Also, what level is 0?
0 is main menu, 1 redirect main menu, 2 game, 3 redirect in game. I am using a redirect scene because I am changing the orthographic viewbof the game in game and screen width and height are not updating.
Has anyone noticed when using stencils that the object being stencilled out wont work if the object has negative scaling? It shouldn't really make a difference.
Well, something clearly isn't right elsewhere. LoadLevel doesn't just randomly fail, so I'm thinking something else is failing and causes the game to throw a fit. Try reducing your redirect scene down to nothing but that script and the required GUIText, and possibly even get rid of the Screen.orientation call. Check if it still happens.
[QUOTE=layla;45562668]Has anyone noticed when using stencils that the object being stencilled out wont work if the object has negative scaling? It shouldn't really make a difference.[/QUOTE] Maybe back faces are culled.
They are but the pixels still don't get stencilled out when I turn culling off in the shader. The pixels are drawn, it just doesn't get masked. [img]https://dl.dropboxusercontent.com/u/99765/5435432.png[/img] One way to fix it is to set the texture tiling negative instead but that's not ideal and I'd have to use quad meshes instead of sprites.
[QUOTE=KillaMaaki;45562669]Well, something clearly isn't right elsewhere. LoadLevel doesn't just randomly fail, so I'm thinking something else is failing and causes the game to throw a fit. Try reducing your redirect scene down to nothing but that script and the required GUIText, and possibly even get rid of the Screen.orientation call. Check if it still happens.[/QUOTE] OK, I will try that and if not I will go into game scene and wait a few second before activating the game objects.
[QUOTE=layla;45562954]They are but the pixels still don't get stencilled out when I turn culling off in the shader. The pixels are drawn, it just doesn't get masked. [img]https://dl.dropboxusercontent.com/u/99765/5435432.png[/img] One way to fix it is to set the texture tiling negative instead but that's not ideal and I'd have to use quad meshes instead of sprites.[/QUOTE] Oh, 2D :v: The back face culling problem would only occur with negative scaling along an uneven number of axes (of the stencil, not the stencilled thing). In that case I have no idea, but it's definitely strange.
Oh shit, I just noticed I can do the same thing with the depth buffer instead. If ZTest is Equal then aslong as the decal is at the same Z depth as the layer of pixels then they should only draw on that layer. It does mean I have to spread each layer across the Z axis but that doesn't matter because it's 2D. I hope I'm not missing something because that would be a perfect solution, works for negative scale sprites too.
What's a good way to save player progress while making it difficult to edit/change? I don't need to store scene states or anything, just which levels the player can access.
Why does it need to be difficult?
Well what I mean is I'm not too keen on storing it in just plaintext and I wanted to know what my other options were.
I'm curious as to why you don't like the plain text option. Otherwise, I suppose you could come up with some binary format for your game saves. JSON or XML are probably easier, however.
[QUOTE=KillaMaaki;45565231]I'm curious as to why you don't like the plain text option. Otherwise, I suppose you could come up with some binary format for your game saves. JSON or XML are probably easier, however.[/QUOTE] I guess I just don't like players being able to easily edit and cheat their saves. And it seems common practice to save games in a filetype that notepad can't edit. Maybe I shouldn't concern myself with what players do with their saves.
I'd say don't worry about it. If players want to hack their saves and cheat, that's fine - that's what they want to do, so let them do it. Even if it wasn't a plain text format, somebody is going to reverse engineer your game save format and figure out how to cheat anyway.
Does anyone know of any unity plugins that allow for some easy brush based level design? Grew up in hammer so would be a lot easier for me, especially since I am not a modeler... Free would be best, but paid is also alright.
ProBuilder's decent. In Unity 4.5 with deferred mode enabled the scene GUI is kinda broken (which is technically a Unity bug, which has been reported and reproduced by the Unity team, who told me they would fix it in the next major version of Unity so.... 4.6?), but otherwise it's pretty good.
[QUOTE=Pelf;45565540]I guess I just don't like players being able to easily edit and cheat their saves. And it seems common practice to save games in a filetype that notepad can't edit. Maybe I shouldn't concern myself with what players do with their saves.[/QUOTE] You can always just dump it to json/xml, then scramble it before saving to disk. It's not terribly secure, but the extra effort might put them off :P
Slowly learning c#/Unity. [url]http://gfycat.com/TinySeparateDegus[/url]
[QUOTE=Kidd;45569619]Slowly learning c#/Unity. [url]http://gfycat.com/TinySeparateDegus[/url][/QUOTE] That's cool, I've been wanting to create a sandbox game with logic gates but I wasn't sure how to make it fun, I could go the way of Gmod w/wire and include physics but that's some hefty competition. I'd like to take it in another direction, puzzle maybe, can't have too many puzzle games.
What I would like to do is make the gates work like puzzle pieces. Outputs snapping to input nodes instead of clicking to wire. I'd have to fiddle with the idea. I'd have to make it so objects don't clip, for example if I have 2 'and gates' outputting to each input of another 'and gate' those models are too big to sit next to each other and connect to each input.
Alright. [code] Vector3 mouseWorld = playerCamera.camera.ScreenToWorldPoint(Input.mousePosition); mouseWorld.z = 0; Debug.DrawRay(this.transform.position, mouseWorld, Color.green); [/code] Using this, it never actually seems to properly be at the mouse position. However when I use the mouseWorld to draw a gizmo pointed to it, it is ALWAYS pointed at the proper mouse position. What exactly is all this about? It really bugs me and is there any way to make it so the ray is always pointed properly at the mouse?
You're giving it a world position, when it actually expects a *direction*.
[QUOTE=KillaMaaki;45573688]You're giving it a world position, when it actually expects a *direction*.[/QUOTE] aahh makes sense. I understand now, still getting use to certain methods of unity. Thanks again!
[QUOTE=reevezy67;45572117]That's cool, I've been wanting to create a sandbox game with logic gates but I wasn't sure how to make it fun, I could go the way of Gmod w/wire and include physics but that's some hefty competition. I'd like to take it in another direction, puzzle maybe, can't have too many puzzle games.[/QUOTE] Make a game not about logic gates, but where knowledge of this stuff rewards the player. Love when games include optional stuff like this that gives nerds like me a nice cup of smug self-satisfaction.
I have no idea how I would go about doing that.
What about rotating mirrors & optics, lasers with logic gates? That would be some nice puzzle :)
Sorry, you need to Log In to post a reply to this thread.