Okay, just for me to understand the situation: you have a lasermask (the draw object) and a laser7 sprite (plus the two sprites for the beginning and the end of the laser). You can draw both lasermasks but have trouble with the laser7 sprite?
yes only 1 draw object masks the sprite not at the same time
Sorry, I still donât understand the issue well. You have one draw object and one sprite, but they donât occur at the same time as they should?
yes I have 2 draw objects lasermask and lasermask2 sorry is confusing names they act as the mask for 1 object laser7 you can have more draw objects but they wonât mask laser7 at the same time ether uses lasermask or lasermask2 which is the problem because that how I have to create the laser.
Could you post your events again?
here is my events the problem is canât mask same object using more than 1 draw object. I donât think this is possible to have additional raycast change the 1 draw lasermask object.
I am still not really sure if I understand the problem. As far as I understand you just need one laser7? Or do you want to attach on each draw object the laser7 sprite? For the latter case I would create laser7 twice, each one together with the specific draw object. If there are problems with the visibility you might need to change the z-order.
yes but I added a copy of laser7 and used the lasermask2 to mask but the problem is the other draw object shows laser7 when the upper raycast is in collision and the middle raycast is not in collision will show laser7
EDIT I canât get the different recasts to mask independently depending on collision and not all at the same time Iâm also not sure how to handle multiple recasts on collision? is there way to do this without recast?
I wouldnât give up on that. You have come quite far already and there must be a solution for solving this problem.
The problem is that the shape painter has no collision. You could experiment with a sprite-object though. You could scale it on the x-axis to have a beam. If it collides, the scale is reduced to the distance between the laser origin and the obstacle.
EDIT ok I got all recasts and draw objects to work at least when on collision with 1 object and not a group now all the raycasts working at the same time so I will keep going
I keep having this problem when different raycasts are in collision with different objects on the x position causing the lasermask to draw on different collisions at once a way around this is to have the raycast that is in collision with closest object control the draw lasermask and ignore the other raycast collisions but I have no idea how to do this in events?
example
events for the raycasts and lasermask
Great work!
You need the smallest x-value of your raycast variables. You can compare the values of variables in the conditions and set the actions accordingly.
idk how to get the x value of the raycast variables? how do I set the variable with the smallest x value as the raycast to draw lasermask?
When you use the raycast you store the position of contact in a x- and y-variable (in your case contactx, contactxx and contactxxx). In the conditions for drawing your laser you can compare the values of these variables. You go to âOther conditionsâ â Variables â Scene Variables. There you can set up something like this for finding the smallest x-value and draw the laser accordingly.
Do this for contactxx and contactxxx as well and it should work.
thanks for the help I setup like your example but I donât think is working? example the bottom âpoint3â raycast doesnât draw the mask object when on nearest collision and still drawing from middle or top raycast?
example
events
I would try to have the raycasts first (not as a subevents) and then compare the values they stored for drawing the lasermask (now you are doing it the opposite way).
Nice work! But wonât it look better if 50% of the laser hits the wall, the other 50% of the laser still passes the wall?
@Epicsleeper Sounds interesting. Can you share the events for that?
@Drona Sounds like a challenge I might look into it. A few replies back it almost looked like it.
)