Collision detection issue
keekee312
Member Posts: 91
Hi, I have 2 invisible actor (both side of the main character) which check if touch is inside himself and follow the main character. If ok, I spawn a tongue actor from the character to where I touch (thanks to magnitude demo). Since yesterday, I tought everything was ok.
In fact, Everything works fine for the first invisible actor on the left side, I can touch anywhere in the area, the tongue is spawn but in the area 2 (right side) It doesn't spawn the tongue everywhere in the area I touch, but only some points.
Thanks for help or if I can send my project to a mod, it would be great.
Cheers
In fact, Everything works fine for the first invisible actor on the left side, I can touch anywhere in the area, the tongue is spawn but in the area 2 (right side) It doesn't spawn the tongue everywhere in the area I touch, but only some points.
Thanks for help or if I can send my project to a mod, it would be great.
Cheers
Comments
Finally, because the first invisible actor works (left side) I deleted the second one and made the first one bigger. But I don't want the tongue to spit out when it's right above the character so I made a rule : when game.mouse.postionX ≠ gameplayerX+{1,2...10} => spit the tongue
but it doesn't work, the game shuts down, why ?
Maybe because the tongue is spawn from the PlayerX position ? So I can I make it work please
Second, are the actors that flank each side of your character actor of the same type? If so, is there any code inside those invisible objects that determine direction?
ALL :
When touch is pressed
when TargetX ≠ gameplayerX+{1,2,3,4,5} (actually, Target X is mouse.positionX and PlayerX is character X position)
=> Then spawn tongue
game.mouse.postionX ≠ gameplayerX+{1,2,3,4,5} means when mouse position X isn't at the same player position X+1 or player pos X+2 or player pos X+3, right ? so I don't know what's wrong ^^ because when I click/touch somewhere on the screen it should spawn the tongue (except PlayerX +1 or +2 position etc) but it does nothing and locks up after 2sec.
And about the invisible actor, it's not the same as Player (I left only one invisible actor which is bigger than both invisible actors before)
If you need a picture or something else, tell me Thanks
What happens if you remove the logic? Does it still freeze?
When I remove the logic (mouse position ≠ ..etc) it works great (I can spawn the tongue anywhere in the invisible area/actor but this is not what I want) so it may be a logic issue..
Now I try to have an invisible actor put above the character (following him also), let's call it CollisionCheck (CC). Its aim is to prevent the tongue spawning.
So, when touch is inside => change TongueOK to false
otherwise when touch is outside : change TongueOK to true.
Then in my Big invisible actor which is the area where the tongue can spawn itself, I set these rules :
When touch is pressed (or inside as you want)
When TongueOK is true
=> spawn tongue...
Still doesn't work. I tried to play with layers but doesn't work, I always have an other issue.
Thanks for help