Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.


  • Content count

  • Joined

  • Last visited

  • Days Won


OcularCash last won the day on August 19

OcularCash had the most liked content!

Community Reputation

1,033 Excellent

About OcularCash

  • Rank
    Team Member
  • Birthday 04/29/1985

Profile Information

  • Gender
    Not Telling
  • Location:
    Springfield Missouri USA
  • Interests
    Javascript, Java, C#, C++, PHP, 3d Modeling, Foley Recording, Photography

Contact Methods

  1. fpskit 1.6 referring to player clone

    If you understood programming, you would know that you CAN assign a GameObject as null. So your error isn't "not finding the playerclone", your error is saying it either can't find an object tagged "Gamemanager" or a component is not attached to it called GameManager. If that object and component was found, then target would be set to null and the NEXT line would throw the error, not this line. That's how you know it's an object/component finding error, not a variable setting error (unless the variable doesn't exist). that is why OMA refers to start using things other than kits to start learning code, your not going to fully understand coding if you just keep modifying kits. Bc object/component finding errors are one of the first things you learn in unity P.S. Not trying to be mean, just explaining why you really shouldn't use kits if you want to advance in programming
  2. Orwell

    Stalker training simulator?
  3. Object tilt on movement doesnt quite work as intended

    Here's a script size cut: void Update() { float v = Input.GetAxisRaw("Horizontal"); Vector3 r = transform.localEulerAngles; r.z = Mathf.Lerp(r.z, v * 15.0, 2.0 * Time.deltaTime); transform.localEulerAngles = r; } but onto your question. If Euler isn't working correctly, try localrotation. I tend to always localrotation over localeuler @UnityGamesRolandbeat me to it lol
  4. Models Rendering - Shaders

    ^^ and FYI, if your shader is removing ambient lighting, your texture needs, well, better textures. Ambient lighting shows geometry, so if your not using it, you need a texture that works with the geometry. In your 3ds max screenshot, you can clearly see ambience, or atleast some form of lighting, in your unity your using "playershader" that's removing it and making it look flat
  5. Models Rendering - Shaders

    Yes, that's a product of shaders. The reason is that 3ds max standard shader is not the same as unitys standard shader, you have manipulate the values to make it look similar. Your biggest issue is reflectivity. So crank that down and you'll see a noticeable difference. Another thing is ambient lighting is set lower in unity than your modeling application, so you'll want to adjust that as well. your model is going to look different in just about every application. 3ds max is going to look different than blender and blender is gonna look different than 3d arch and so on because everyone of them are using different shader models and default values.
  6. UnityEditor AutoSave

    This is a super simple script that creates an autosave for unity. This is not for ingame saves, this is for the unity editor. Anytime something is changed in edit mode in the hierarchy, it will automatically save your scene for you. If you want it to stop, just change active to false, simple as that. This script just goes in your project, does not belong in the scene. using UnityEditor; [UnityEditor.InitializeOnLoad] public static class AutoSave { private static bool active = true; static AutoSave() { EditorApplication.hierarchyChanged += OnHierarchyChanged; } public static void OnHierarchyChanged() { if(!EditorApplication.isPlaying && active) { UnityEditor.SceneManagement.EditorSceneManager.SaveOpenScenes(); } } }
  7. What's wrong with my register.php code!?

    What are you writing your php in? Are you writing it online or in an application?
  8. Welcome Window (Form)

    Decided to do something a little different and make an example "Welcome Window" that creates and displays a form welcoming the player. This example requires you to use .Net 2.0 instead of the subset by going to edit>Project Settings>Api Compatibility Level. It also requires System.Drawing.dll and System.Windows.Forms.dll placed in a folder named "Plugins". You can find and copy them from C:/Program Files/Unity/Editor/Data/Mono/lib/mono/2.0. All textures must also a compression to none and read/write enabled. Here is the example: using System.Windows.Forms; using System.Drawing; using System.Collections; using System.Collections.Generic; using UnityEngine; public class WelcomeWindow : MonoBehaviour { public string gameName; public string version; public string gameInfo; public string supportPage = "http://www.armedunity.com"; public Texture2D gameImage; public Texture2D[] screenShots; public Vector2 windowSize = new Vector2(1100, 530); public int splitterPosition = 360; private Form f; private SplitContainer s; public void Start() { Show(); } public void Show() { if (f == null) GenerateForm(); f.ShowDialog(); f.BringToFront(); f.Focus(); } public void Hide() { if (f == null) return; f.Hide(); } public void Dispose() { if (f == null) return; f.Close(); } private void GenerateForm() { PrepareForm(); PreparePanel1(); PreparePanel2(); } private void PrepareForm() { f = new Form(); f.FormBorderStyle = FormBorderStyle.FixedDialog; f.Size = new Size((int)windowSize.x, (int)windowSize.y); f.Text = "Thanks for downloading " + gameName + " " + version + "!"; s = new SplitContainer(); s.Dock = DockStyle.Fill; s.BorderStyle = BorderStyle.Fixed3D; f.Controls.Add(s); } private void PreparePanel1() { s.SplitterDistance = splitterPosition; s.IsSplitterFixed = true; PictureBox p = new PictureBox(); p.Image = ImageFromTexture(gameImage); p.SizeMode = PictureBoxSizeMode.Zoom; p.Location = new Point(0, 0); p.Size = new Size(splitterPosition, splitterPosition); s.Panel1.Controls.Add(p); Label l = new Label(); l.Text = gameInfo; l.Location = new Point(0, splitterPosition); l.AutoSize = false; l.Size = new Size(splitterPosition, (s.Size.Height - splitterPosition) - 45); l.Font = new System.Drawing.Font(FontFamily.GenericSerif, 16); s.Panel1.Controls.Add(l); Button b = new Button(); b.Height = 40; b.Text = "Support Page"; b.Font = l.Font; b.Click += new System.EventHandler(Support); b.Dock = DockStyle.Bottom; s.Panel1.Controls.Add(b); } private void PreparePanel2() { TableLayoutPanel t = new TableLayoutPanel(); t.AutoSize = true; t.CellBorderStyle = TableLayoutPanelCellBorderStyle.Inset; t.ColumnCount = 2; t.RowCount = 2; s.Panel2.Controls.Add(t); t.Dock = DockStyle.Fill; for(int x = 0; x < 2; x++) { for(int y = 0; y < 2; y++) { int i = x * 2 + y; if (i >= screenShots.Length) return; if (screenShots[i] == null) continue; PictureBox b = new PictureBox(); b.Image = ImageFromTexture(screenShots[i]); b.Dock = DockStyle.Fill; b.SizeMode = PictureBoxSizeMode.StretchImage; t.RowStyles.Add(new RowStyle(SizeType.Percent, 50F)); t.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F)); t.Controls.Add(b, x, y); } } } private Image ImageFromTexture(Texture2D t) { if (t == null) return null; byte[] byteArray = t.EncodeToPNG(); using (var ms = new System.IO.MemoryStream(byteArray)) { return Image.FromStream(ms); } } private void Support(object sender, System.EventArgs e) { UnityEngine.Application.OpenURL(supportPage); } }
  9. Place Buildings on Terrain

    Shouldn't those be a + 3 not a - 3? Because your loop is using + 3 but your check is using - 3
  10. Place Buildings on Terrain

    Make sure that heightmap is the size of the terrain (heightMap[terrainWidth, terrainHeight]). In addition, just to make the error isn't going to happen to mess it up on the sides, when you say heightMap[x,y] = posy; enclose it in an if statement saying if(x >= 0 && x < terrainWidth && y >= 0 && y < terrainHeight) that way if you place near the edge of the terrain it won't throw the error as well
  11. Place Buildings on Terrain

    Your for(int y.. loop is saying x < instead of y <. Could be the culprit of how long it takes as well as your error
  12. JS Menu Item

    Since I switched to Unity 2018.1 I haven't had a menu to create js files so I made my own. Remember, any version of unity past 2018.1 this will not work since javascript is deprecated. Create a file in your folder, name it JSEditor.js, then go back into unity and open it up. Then just drop in this code and your js menu's will reappear. I did make a small adjustment when it comes to creating the file tho, when you click the menu item it will open a savefilepanel. So here it is: public class JSEditor extends EditorWindow { private var text : String = ""; @MenuItem("Assets/Create/JavaScript", false, 80) static function Init() { var path = EditorUtility.SaveFilePanel("Create New JS", Application.dataPath, "New Behaviour", "js"); if(path == null) return; GenerateScript(path); } static function GenerateScript(path : String) { var sr = File.CreateText(path); sr.WriteLine("function Start(){"); sr.WriteLine("}"); sr.WriteLine(""); sr.WriteLine("function Update(){"); sr.WriteLine("}"); sr.Close(); AssetDatabase.Refresh(); } }
  13. Could this be real?

    Not sure exactly what you mean
  14. Looking at your code again and it looks like your asking for hit3.point which doesn't exist because it belongs to the previous if statement. Put hit3 variable outside of the if statement so it's not confined to that if block
  15. I'm not seeing anywhere else that could be be the issue unless it is is being called but the rays messed up. Where you have the comment (THIS PART OF CODE NOT WORKING) put Debug.Log("called"); and see if it prints to the console. If it isn't being called, then put Debug.Log("isSelected is " + isSelected.ToString()); right before the if statement