my ray shooting python script... I need help!!
I am trying to make my FPS game to where once the ray hits the object and the fire button is pushed, the the ray ( crosshair ) sends a message to the object that was last hit a message to either lose health or be pushed bak. The only thing is that evry time i run the game engine, it always says "function takes exactly two argunments,only 1 given.
heres the script im using...
cont = GameLogic.getCurrentController()
own = cont.getOwner()
fire = cont.getSensor("fire")
aim = cont.getSensor("aim")
force = cont.getActuator("add_force")
forceobj = aim.getHitObject()
name = forceobj.getName()
( own is the crosshair btw )
The .blend file can be found here http://www.mediafire.com/?9xjzz1hhmob
The first person to tell me whats goin on will get a spot in the credits.
Last edited by sagedread; 24-Feb-08 at 17:28.
Wow, I'm surprised nobody's responded to this. If this is the only problem, at the end where you say GameLogic.addActiveActuator("Force, True"), the correct syntax is GameLogic.addActiveActuator(Force, 1). The actuator name shouldn't be in quotes, and the true value should be 1 (Boolean values in Blender are either 1 or 0; 1 is true, and 0 is false). The string is counted as a single value. Check the console to see what the problem is; usually, the console will tell you what the error is and where it is if there is one. Hope that helped!
Last edited by SolarLune; 26-Feb-08 at 14:30.
ooooooooo thats why most my stuff wont work when i use . 'true/false' Thanks alot man!!!
thnx alot man. This works so much better then makin a different message for every single object on the map.