Here is my problem. I am making a skill game that is based on a horizontal grid. So, in the game, I need a cursor movable with the Left Stick. This wouldn't be too hard to do with OPEs but there is a problem. I need to know which grid the cursor is over. My original idea was to use area triggers over the grid so that when the cursor was in the area, the area triggers would activate some code. I then realized that you need physics to activate area triggers. I also know that OPEs don't work well with objects that have physics activated.
So I need some help coming up with a solution. My options are:
a. Use OPE movement and have some way to trigger the code when in the correct area.
b. Use physics to move the cursor.
c. other option.
Any help would be appreciated, thanks.
Have you seen my grid movement tutorial? Or this is not the issue? Would work perfect for you moving the cursor in a specific amount of distance.
Can you not move the physics bubble to the area? That will be the best bet. Using on active and inactive with area triggers (tied to the cursor of course)
So my option is OPE movement with area triggers.
I saw your grid movement tutorial, very helpful.
So, do you mea attach the physics bubble to the cursor and then move them together using the grid movement and the physics bubble will activate the area trigger that runs the code.
Glad it helped
Yea. You can put the cursor as the game character and have the physic bubble follow the game character (physics bubble can't move via OPE, learned this making my current project)
or you can increase the physics bubble size to in corporate the entire grid area.
Jarr388tt's suggestion of using the cursor as the game character is your best option. Physics don't work we'll with fast moving OPE'd objects, but a cursor will work just fine with an area trigger OPE'd to it.
It depends what hes doing. An area trigger in each square might be necessary....Originally Posted by JaminBen007
I would because I need different code in each grid section.Originally Posted by Jarr3tt88
If you need more help Luke you know where to find me
That grid movement I made, I would highly suggest using it, and it gives the constraints. Wish I knew about it when I made minesweeper or code cracker haha
hi
if you have the DLC use screen X,Y from the object info source
the screen value x/y represent the screen from -1 to 1 on both x/y/z (depth)
you need to offset and scale these values to obtain your grid coordiantes.
eg
say grid is 10x10
the screen is from -1 to 1 so add 1 to the object info screen x/y
now obtain a scaling value 2/grid size=2/10=0.2 , screen coordinates per grid coordinate
now if your cursor at -0.3,0.1 add 1 to both x,y screen values so its in the range of 0-2
making cursor 0.7,1.1
now divide these values by the scalar 0.2 and floor the results so
0.7/0.2=3.5 , floor(3.5)=3 making x=grid 3
1.1/0.2=5.5, floor(5.5)=5 making y=grid 5
edit: this is really only basic cursor to grid as its intended for a full screen grid, if however your grid doesn't take up the full screen you will have to offset the cursor position by grid outer corner at 0,0 and adjust your scaling value to reflect this
so if your grid starts on screen at 0.2x0.2 , subtract this off the cursor position before scaling by (2-0.4) divide by grid size
hope this helps.
edit: this only dynamically updates the value when the back button is pressed inside the editor, otherwise it remains a static value.
Das your stuff is always so complex and math oriented! haha
My grid movement works based on increase events/decrease events. Those are the values for the X/Z position for the OPE.
They are constrained by filters if you got 4x4 grid, and movement is 4m, the filter will have 16 which will turn off the stick movement. I'm at work I can't link my vid :/