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.

OcularCash

ADG
  • Content Count

    3,875
  • Joined

  • Last visited

  • Days Won

    131

OcularCash last won the day on January 20

OcularCash had the most liked content!

Community Reputation

1,051 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

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. First shuffle the deck (array of cards). Then you can use while(hand < 5) to keep looping until you get a full hand. Now the tough part bc I don’t know your code (how the values are laid out), I’m assuming there’s only 1 card of each value from 4-36. but you want to grab the first card (obviously). Then check if the second card is <= 60 - firstCard - 22 “4 + 5 + 6 + 7” unless one of those numbers was the first card. And so on and so on. There’s too much stuff to explain but the jist is, make sure you don’t get to 60 before the 5th card and make sure there’s atleast 1 card left in the deck that will keep you under that value by card 5. You looking at a lot of comparing, and if you mess up, look forward to crashing your computer several times. So make sure all your checks are correct so you can break out of the while loop every time. edit: and before either 4, 5, 6, 7, or 8 is chosen, replace it a value < 60 - hand. So if 9 is lower and you choose 5, value now has to be lower than 60 - hand - (4+9+6+7+8) depending on how many cards you still need in your hand. If you still need 3 cards then it’s just (4+5+6) or (4+9+6)
  2. Another way is to generate random path first, put them in a list and when creating tiles, don’t put a mine if it’s part of the path psuedo: List<Vector2> path = RandomPath(width, height); for(int y = 0; y < height; y++) { for(int x = 0; x < width; x++) { bool a = false; for(int i = 0; i < path.count; i++) { if(path = Vector2(x, y)) { a = true; break; } if(a) continue; if(Random.value < 0.5) PlaceBomb(x,y); } } } Edit: just remember when creating a random path, you need to a* it back to find the shortest path. But if you are going to keep it 4x4 and never bigger, you can also just place bombs at 3 out of 4 nodes diagonally and a* to the finish since 4x4 isn’t very big to begin with. I.e. int c = 0; bool done = false; for(int i = 0; i < 4; i++) { if(!done) { if(Random.value > 0.8 || i == 3) { done = true; continue; } else { c++; placeBombAt(i, i); } else placeBombAt(i, i); } } FindPath();
  3. https://github.com/googleads/googleads-mobile-unity/blob/master/samples/HelloWorld/Assets/Scripts/GoogleMobileAdsDemoScript.cs take a look at the delegates in the start function
  4. OcularCash

    Email send c#

    To see if it’s sent, you can just surround it in a try catch and it should notify you if it fails try { smtpServer.Send(mail); } catch(SmtpFailedRecipientException e) { Debug.LogError(“Failed to send!”); } edit: psh, didn’t even read the last part of geckoos reply
  5. What is it your actually trying to do? If your just trying to get the length of a side after it’s created it’s just (p1 - p0).magnitude instead of all that fancy stuff i.e. Length = distance between any 2 neighboring vertices edit: with your function tho, also make sure your multiplying a float as well. 2 * radius is int * float which returns an int vs 2.0 * radius is float * float which returns a float vs radius * 2 is float * int which returns a float. Your float casting is for the whole equation, things inside it must be cast as well. I don’t know if that fixes the equation or if unity is auto converting 2 to 2.0 but it may help
  6. @OneManArmy that’s why I stated in some cases. Depends on the complexity of the final product and the size and probability. Ran into this issue with the slot machine when I was randomizing symbols based on money in the machine. At one point on Android had a hiccup of almost half a second using the same while method because the probability factor was too low compared to the amount in the machine. Was more looking towards what his end product might be since we don’t really know how complex he’s wanting to go in the future @Logystone good to hear
  7. OMA is correct. But another option is to have a list of indexes and remove/add indexes when you click the button and randomly select an index from the list of indexes. Tho while loops would work, it could cause possible hiccups depending on how many times the random number is continuously the same as the current index. Although doing it the method I just explained CAN BE (not always) more efficient, it is also more complicated to understand if you haven’t messed with that sort of thing before
  8. There’s a few different ways to handle instantiated scripts accessing static scene scripts (or vice versa). Here is a couple options (but not limited to): A: use static functions to carry out calls B: using FindObjectOfType to find the gameManager script in the scene C: have a script on the player that points to the gameManager. ie (player.gameObject.SendMessage and the player can tell the gameManager what it needs) theres a million on ways to do it. But the jist is either statically call it, find the component or call a function on another object that points to the component you need
  9. Moved to the help section. FPS mod section is for mods for the FPS kit, not help questions with a project non kit related. for your question, FPS games don’t use an entire body, just the arms. But if your really wanting to use the entire body, go into mixamo:rig and look for neck or head and place the camera there but if the animation has any jitters, your camera is going to jitter as well
  10. Looks good. Reminds me of mist of the old dos games I used to make. RIP deja vu
  11. Is this a UI related question or a function related question?
  12. https://docs.unity3d.com/ScriptReference/Rigidbody.AddTorque.html https://docs.unity3d.com/ScriptReference/Input.GetAxis.html like geckoo stated, try it out yourself. Above is all the reference material you need to make it work
  13. The problem with your code it’s hard coded. But you know that. All you have to do is know how to create a procedural circle. A hexagon, decagon, etc is just a procedural circle with a set number of points. You can either look at my code for weapon selection on page 2 of the scripts section for 2d or look at this for 3d: https://answers.unity.com/questions/944228/creating-a-smooth-round-flat-circle.html triangle is 3 points, square is 4, pentagon is 5, and so on
  14. Good to see you got it going. Friendly advice tho, change enemiesInRange from a list of gameObjects to a list of enemyPath. All those get components eat up a lot of rss bc your using it an update loop. So just cache the component on trigger enter and you don’t have to get it up to 3x, 60 times a second. edit: and whenever you need to transform or go, you would just call enemiesInRange[index].transform (or gameObject) since the component caches the transform/gameObject that it’s attached to
  15. Grab that vert in blender or whatever you use and move it forward/backward and see if it’s a combined vert in your modeling app. If it’s is, looks unity is splitting the vert and putting it in the wrong place. If it’s 2 different vertices, combine the 2 and it should fix it p.s. On the other one, it looks like a simple light leak caused split edges (2 edges that doesn’t share vertices)
×
×
  • Create New...