Hi,
I've had Playmaker for a couple of weeks now and have fumbled through a couple of the tutorials etc.
I've been trying to experiment with raycasting, basically just for my own education more than anything else. I've kind of blundered in to this and got stuck on something that is probably very, very basic.
I've got a scene with a character and a cube. The cube is off the ground and "use gravity" is unchecked.
I've got the "Raycast from Game Object" script from these forums.
The aim is pretty simple. Hold down the right mouse button, click the left mouse button, raycast, check that I have hit a tag called cube, turn gravity on on the object I have hit, causing it to drop to the ground.
This sort of works. When I click I get the raycast, which hits the environment, checks it has hit a cube and turns on gravity. The problem is that either the raycast keeps on going, even when the buttons aren't pushed, then I hit loop count exceeded 1000.
Where the raycast hits the cube Gravity comes on and it drops. Where the raycast hits something else, nothing happens.
What I have is....
Start ---
Get LMB down (store as Bool "Left")
Get RMB down (store as Bool "Right")
Bool all true ("Left" and "Right") send event Raycast
Raycast ---
Raycast from game object forward 100.
HitEvent is blank
DidHit is "DidHit"
HitObject is "HitObject"
Bool if DidHit is true then go to Cube Check
if Didhit is false then go to Finished and back to the start
Cube Check ---
Game Object Compare Tag "Cube"
if true then go to Gravity
if false then go to Finished and back to the start
Gravity ---
Set "HitObject" to use gravity
then go to Finished and back to the start.
Any help, or an example, would be much appreciated!