Blockland Forums > Modification Help
Activate different parts of a brick?
xS K I D z:
Not too sure where to post this but I think mod help is fine.
I was looking at the interactive vehicles and how you can open the doors and trunks of cars and was wondering if this can be done with a brick? That is, looking at one part of a brick and "activating" it and it changes states or something and then looking at a different part of the same brick and "activating" it and it does something else. Basically creating zones on a brick that are clickable and react to whatever you want them to do.
I did a few quick searches and couldn't find anything out there that was similar to my curiosity so I'm hoping more experienced mod-makers can shed some light.
Thenks
PhantOS:
Bricks have an orientation value called angleid which controls north, east, south and west. Using this in conjunction with some vector math (see: Pythagorean theorem, quadrants) and you can get which (side) your aim vector lands on. It would require a lot of fine tuning to get the exact sides you're clicking on, and would probably require you to take the size of the brick into factor. It probably wouldn't be an easy task for someone as inexperienced as you (no offense) vector math can be very difficult to work with
There might be a parameter under onactivate that already checks the side of collision being clicked on, but I wouldn't know
mctwist:
OnActivate is called from the engine. It sends in in addition to player and client, the position and vector. It is the same functionality as OnActivate on Vehicle. The position or vector is not send further, so a package is required in order to retrieve those.
PhantOS:
It's probably better to package it through ontrigger then and fire a raycast
xS K I D z:
Thanks for the help. And yea there's plenty of info about vectors and raycasts out there, which was what I was expecting to be working with. It's just lots of trial and error (for me) to figure out how to tell the add-on what to do with that information once I technically have received it.
For someone who doesn't do this every day it can be a task. I like learning about it tho, just frustrating when I have all these ideas and don't know how to execute them all the way thru lol.
I will update if I have a breakthrough :)