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


Everything posted by OcularCash

  1. TakeDamage needs to be an rpc bc all copies of the character on each client needs to know it’s taking damage, at minimum, the the client that owns that’s object does. the most common thing you see ppl doing is calling the damage rpc on all clients, checking if it isMine (the client owner), if it is, then deduct health and sync it to all clients. It’s a hair less efficient, but it works. You can also (I believe) only call the rpc on the owner and then sync the health on all clients, that way only the owner receives the initial call. Don’t know for sure but pretty sure you can it that way. But both approaches work just fine
  2. I’m just generating the clouds using 2d simplex noise on a chunk by chunk basis. So when I chunk is generated, if that chunk is in a blob zone, build a cloud that covers the top of that chunk
  3. So a little update. I just got back from vacation and dabbled in this again a little. I fixed some of the bugs including the tree leaf problem between chunks. Also added clouds and plants and a temp main menu to input seeds and swap texture packs and so on. Just wanted to show a bit bc yes, I'm not just stopping at a simple voxel terrain and calling it finished like what you normally see people doing, I will be doing the whole show just my own version of it the way I want it
  4. I know I know, tons of minecraft like stuff out there but I started working on something for my 5 year old last friday. He's still loves minecraft and I couldn't find anything worth a crap that was minecraft related and vr for ios so decided to make it myself. Like I said, I only just started it a little over a week ago but a big chunk of it is already done outside of some minor glitches (like tree leaves not going where theyre supposed to go if it's on the side of another chunk). Alot of stuff has not been added like water physics (outside of drag when walking in it), no ai yet, haven't tuned in some of the algorithms for block generation, no menu or large inventory or anything yet. It does run very quickly tho so don't be afraid to use max settings, even if you are on a less than average pc But if you would like to try it in it's current state, I'll post a link below. Once it's close to being finished and before I add vr I will post the source here in the forum. (right click) to remove a block. (left click) to place a block. (q) and (e) cycles which block your holding. Mouse is currently not locked for testing reasons so watch where you click and there is no boundary barriers in place yet HERE IS THE LINK TO THE BUILD
  5. 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)
  6. 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();
  7. 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
  8. 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
  9. 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
  10. @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
  11. 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
  12. 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
  13. 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
  14. Looks good. Reminds me of mist of the old dos games I used to make. RIP deja vu
  15. Is this a UI related question or a function related question?
  16. 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
  17. 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
  18. 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
  19. 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)
  20. Just looks like to me that the uv is overlapping the texture in blender, click on the those triangles and make sure it’s mapped correctly on the texture
  21. I have no idea. I’ve never used either so not sure when they’re called. But that “is” something that could double the calls. Wait, what’s up with the addcallbacktarget being called in both enable and disable?
  22. Check in the scene and see if there is 2 objects in the scene with this script attached in play mode ( not in edit mode). Your code looks ok so I’m guessing with dontdestroyonload, somehow or someway 2 of the same scene objects are ending up in the same scene
  23. In rpcloadedgamescene is the info being logged twice in the console?
  24. Not sure, I don’t use singletons very often. I know @YoungDeveloper is a singleton fan tho so he might know
  25. It could continue to work, it could not. Idk how unity calls for instancing but my guess is it’s sorted maybe (by name or size or something), where your input manager is created and stored closer to the end of the list to update than your test script. I’m saying it’ll most likely always work as long as input manager is stored after the other script. but like I said, idk how it’s ordered and called p.s. When I write my engines, when a scene instances, it starts it like this (create game object>transform add components in order and called awake as each component is being created). For instance: for(i < scene.objects) { go = new instance(scene.objects.go); for(c < scene.objects.components) { Comp = go.addcomponent(...[c]); } public class component : behaviour { public component() { Awake(); } } so it depends on where it’s store in the scene/project file. One can use awake to access something like that as long as it’s created after
  • Create New...