getting the 8 digit float help

Hi, I’m trying to have a test on a hashing and raycasting, which is needed in a multiplayer network game. What I’m trying to do is get the value and the key that I will pass to the hash table once I raycast an object in a plane. Can anyone provide me a link of useful tutorial on this. And can anyone please help me to figure this out? Thanks.

just lookup the script reference for raycast and search the web for hashtable tutorials.

should give you all you need.

You won’t find tutorials on such trivial topics that require a few lines to be done I fear.

I already got the raycasting thing. now I’m struggling on how I could put the values to the hashtable. seems that the documentation has not enough explanation on this. :frowning:

Here is an article that should get you further :slight_smile:

oh, I’m into javascript and haven’t explore C# yet. but I think it could help. Just found some minor differences between C# and javascript. Thanks :smile:

Hey, I’ve been researching about hash tables for 3 hours because it’s not clear to me why my lead wants me to use a hash table for this test. and I couldn’t find enough resources on what really is a hash table. Yes, it is a collection of key/value pairs which maps keys to value. But what really is the function of a hash table? :roll:

The function of a hash table is to map a value to a key.

An array will only allow you to map a value to an integer index, which can at times be usefull but in most cases isn’t of much use.

Reason arrays are often of no use is:

  1. You don’t alway have keys that are all in range of 0 - x
  2. You don’t always have small keys
  3. You don’t always have integer keys at all

In such situations, hash tables are the only way to adress it as any object can work as a key in a hashtable, this especially means that you can throw in arbitary integers as keys without wasting a lot of ram for all the unused slots inbetween. Yet you still have a very fast access time (unlike you would have with array lists).

Okay, thanks for this info dreamora. :slight_smile: It would help me in the future because for now I’m assigned to study unity using C# and I’ll just leave this problem hanging for now. But I’ll get back to study about it again.

Hope to see your name in my other posts! :lol:

[a fresh graduate who’s glad to have a forum like this] :smile: