i need help in creating an object in a game that would make my character move along it’s path.
Example:
when it steps on tiles like [>>][>>][>>] it would move to the right, yet the character should still be able to exit this path at any time. how would i make this
also i would like help in makeing an abject that when stepped on, would transport the character
Example:
If the following letters represented a transporting area.
A B
C D
If character approches “A”, coming from the top… it would teleport it to “C”. Yet if the character steps on “A” coming from the left, it would teleport it to B.
For the path, it sounds like your trying to do something along the lines of a conveyor track. If so simply add additional force to your character in the direction that the track is supposed to move him. The addition of other forces for movement should give you the default ability to leave the track at any time.
The teleport function can be very easily implemented with a python script using “own.setPosition()”. I recommend you make the teleport tile out of four planes (one at the edge of each side of the teleport tile) this way you can use setPosition() in relation with the side of the tile that you first contacted.
make a 2 frame animation, leave the first however you want, but then in the second frame have the character where you want it to teleport to.l Now, all you have to do is make the IPO play frame 2. The character will now be wherever you want it to be.
I am still trying to figure out the logic bricks and learn python… I am mostly a modeler hobbyist and was intrigued by GE and the logic bricks,(thought maybe I could point and click the problem away) I have spent a few nights trying to understand the principles of python but my time is very limited and I get impatient sometimes… And i’m not much of a programmer.
I will take your advice and look a bit further into python and figure this out.
You didn’t follow my instructions, read the code in my previous post again.
Use the setPosition function exactly like this: obj.setPosition([4.631,5.603,2.067])
There should be NO EQUAL SIGN between setPosition and ().
Get it?
PS: You can get rid of the “import GameLogic” line at the top. As long as cont is set to “GameLogic.getCurrentController()”, you don’t need to aditionally import GameLogic, it’s already there.
Ok, I might have done several things wrong, First was python 2.5, Second I Also had VPython 2.5, I uninstalled it, not sure if that was neccessary but poof it’s gone! and last I was executing the script with the right mouse button, I still get those errors when I do that but What you gave me WORKS…
I tried doing it with my project and SUCCESS…
Thanks, A Bunch
I hope you win the lottery Social!