|
| 25 Jan 2015 04:24 PM |
I'm trying to get a local billboard GUI that is stored in another player's head to become visible once you and the other player are close enough together.
Just a hunch but I don't think I want to use magnitude. |
|
|
| Report Abuse |
|
|
|
| 25 Jan 2015 04:25 PM |
| Use raycasting then. Magnitude is best, raycasting prevents seeing through walls, and pathfinding is impractical and inefficient and not what you want. |
|
|
| Report Abuse |
|
|
|
| 25 Jan 2015 04:27 PM |
| But I don't want a function going off every time another player moves to see if they're close enough..? |
|
|
| Report Abuse |
|
|
|
| 25 Jan 2015 04:31 PM |
Then display it all the time. If you make it efficient enough, it will hardly make a difference.
You don't need to do it 30 times per second, you can just do it every 1/15th or 1/10th of a second. |
|
|
| Report Abuse |
|
|
|
| 25 Jan 2015 04:59 PM |
I guess.
But I need it displayed only when a player comes close enough to you. Anyway, wouldn't all of those functions lag the game a little bit? |
|
|
| Report Abuse |
|
|
|
| 25 Jan 2015 05:05 PM |
| I need it done really fast -- like as soon as the player enters the perimeter. |
|
|
| Report Abuse |
|
|
|
| 25 Jan 2015 05:18 PM |
If we hypothesizing, I have 3 solutions off the top of my head.
Solution 1: You could make a cylinder that is welded around the player which radius is the activation distance, that is transparent and cant collide, and have a script that waits for something to touch it, then check if it is a player that touched them and act accordingly.
Solution 2: You can use a local script to do the calculating for you (using magnitude which is really easy once you understand what it does) then when it finds someone close enough acts accordingly. (No lag to the server as the client does the calculation)
Solution 3: If you have filtering enabled, you could still use a local script, but you then would need to add a remote event that sends its find to a server script (and you can make it double check if you are suspicious of people) then act accordingly.
Of these, I like solution 3 the best. (1) It seems like the most fun to script, (2) It has filtering enabled which I like to have in my worlds. |
|
|
| Report Abuse |
|
|
|
| 26 Jan 2015 12:19 PM |
| I had the same idea in your Solution 1. I might go with that. |
|
|
| Report Abuse |
|
|
| |
|
|
| 26 Jan 2015 09:55 PM |
| Whatev I'm just going to do the brick thing. |
|
|
| Report Abuse |
|
|