Hey Boxers, Does anyone know how to set the slingshot's rotation to a half revolution? Right now the Pool template is set so the player can shoot the cueball in any direction. I want the player to only be allowed to shoot it in a half circle, not full. Is this possible?
I was hoping it would be something easy but I'll have to look into this. I tried manipulating the code already but unfortunately no luck.
Yes that is correct. I want the arrow to point forward and I want the player to only be able to shoot in a half circle(looking straight ahead). Right now they can shoot behind them(full revolution) and that defeats the purpose of what I want them to do.
Change the touchMode function in the Slingshot node to this Code: function touchMove( point){ if(!_hit){ return; } var wp = this.scene().screenToWorld(point.x, point.y); wp = new Vec3(wp.x, wp.y, wp.z); if(wp.z>=0.0) { this.setCuePosition(wp.x, wp.z); } }
This is fantastic! Thank you for taking the time to figure this out. It works exactly how I wanted to. The only problem now is that the slingshot function doesn't work the same. When you pull back the line, the cueball only moves about an inch. I'll have to try and figure this part out now. Thank you so much again for this!
@Stryder no problem I never had a working version of the node so I just guessed what it did. If you have another version then you really only need to wrap the setCuePosition in the If statement so just take the If from the code above