(Klein) #1

I making an football game.
How can i make the ball when it is in the goal go back to the start position(To the middle field)?..And how can i make it without set scene?

How can i make an cube as an collisions box(not the default sphere)?

I making an car-racing game.
I have an carbody and wheels,how can i make the wheels rotations according to the car acceleration? I tried to make it with rigidBody but then the wheels dont track the carbody.

I would thank everybody who can help me a lot!

(kos) #2

about the default collision box thing i would like to tell you that the versoons of blender that so far have been published do not have the option to make the collition box something other than a sphere.NaN was about to solve it but in the mean time the bankrupcy happened.
and to the increasing rotation of the car-wheels at the time of accelaration you can write a very simple python script. i myself have used the script to animate a F-22 plane. if you wish you can contact me on [email protected]…bye

(Klein) #3

Thank you for your answer.
Can you tell me the python script i have tried to go to your site but it doesnt work it allways go to the main yahoo site.
I have version 2.23 of blender what do you mean with there is no default bounding box?

(Monkeyboi) #4

The simple answer to the sphere problem is: There is no alternative! You can only use spheres.

(kos) #5

alright…! i was been very busy for the F-22 project.but as it is finished i am quite free now. i used a py script to make the wheels of the F-22 rotate proportional to the motion of the master empty. it can be achieved by the very simple formula->s=l*ang
where s is the distance travelled by the master empty. l is the radius of the wheel and ang is the angle that the wheel is to be rotated.mkeep in mind…it is in radians. you have to convert it in degrees by multiplying ang by (pi/180).this is the basic thing. the python script would be a bit different if you are using it in game rather than animation. as i do not make games in blender i do not know the python implementation of game-blender.but if you wish i can learn it and post it to you in 3 or 4 days.reply me…bye

(Klein) #6

Thank you for your answer.
I would thank you very much if you send me the code, if it is not too much work, it seems to be a little bit complicated.
At the moment i have no e-mail can u write it here in the topic?

(azrael) #7

All though you can only use spheres for colision, what is nothing stoping you from pulling the sides of the spher to make a square.

This may not give you the full desired results, but is better than nothing


(kos) #8

yes i will. but as did i say before it would take a couple of days to do the game scripting because of my very little knowledge of game scripting.but if you wish i can write you the script that i used in my animation by tomorrow…and if you don’t mind waiting i would surely deliver the py script for the gaming in a couple of days.

(Klein) #9

Thanks all for the answers
I have an question to the answer of azrael.
How can i pull the sides of the collisions sphere?

(kos) #10

hi there…I am back with the python script for animating the wheel proportional to the distance travelled by the car.first of all make the car-mesh child of an empty,say “car_empty”.also make the wheel child of another empty named say “wheel_empty”.make the “wheel_empty” child of “car_empty”.actually in real world the distance travelled by a car depends on the rotation of the wheels.but for sake of simplicity we will reverse the thing. we will make the car move and the wheels will rotate proportional to goes the script:
>import Blender
>import math
>car_empty = Blender.Object.Get(“car_empty”)

Link the script to the “car_empty”.
Now add an IPO curve to the car_empty that defines an accelaration .press (Alt+a) to see how the wheel rotates proportional to the motion of the car.
[here “radius” is a numarical value. it is the radius of the car measure the radius of the wheel simply select the wheel out of edit mode and press ”N” .then write down the LocX of its centre . again in edit mode select a vertex that is one of the outermost vertices of the wheel and has the same LocZ with the centre .now substruct the LocX of the centre from that of the verex.if LocX of vertex<LocX of centre then do the reverse.write down the result in place of ‘radius’ in the script.KEEP IN MIND I modelled the wheel in front if you are modelling in side-view all the “LocX”s should be replaced by “LocY” including that of the script and all the “RotY”s should be replaced by “RotX”.]
NOTE:-KEEP THE “wheel_empty” JUST in the centre of the wheel.
That’s all….the same scripting in game-blender will a bit different.the LocX or LocYs will be replaced by Forces .The scripting for the game will follow VERY soon……BYE.(good luck and happy blendering!!) KOS J

(Klein) #11

Thanx a lot for the python script!!!