is it possible??
:eek:
It sure is! There are a few ways you can do it too.
The first way would be to give every dynamic object a Constraint actuator that restricts it’s movement on one axis. For a side-scrolling platformer, restricting Loc Y with min and max values on 0.0 will do fine. Make sure your constraint actuator is linked up with an always sensor.
The second way, would be to make two gigantic invisible planes to sandwich your game on the forbidden axis, literally physically restricting movement along that axis. However, with this setup, you run the risk of objects falling out of your sandwich.
The third way, would be to make a python script that sets the position of all the dynamic objects on the forbidden axis to 0.0.
The first way is the best way, and is the one I suggest.
hey thanks (you might laugh, but i tried the sandwitch trick long before gG) but of course constraints are more comfortable
but there is still one thing:
i want to reduce (or remove) rotation of two axis (does this work with the orientation constraint??)(if yes, how)
by the way… Thank youChaser!!!
I like your style.
I’m unfortunately not using a “real” computer right now, I’m away from home, so I’ve only got an old version of blender. I’m not familiar enough with the latest blender version to have memorized the new constraint actuator improvements, but I’m sure restricting location can be acheived with the orientation constraint you spoke of. I’m not sure how, but I do know orientation is directly related to rotation and size.
My guess is that you’d want to forbid rotation on the X and Z axes, leaving only Y axis rotation available (if it’s a side-view kind of 2D game).
hmmm that makes sense
but i don`t know if the parameters are vectors or euler angles (pan,tilt and roll)
(and of course iam too lazy to try gg)
ok it works with the orientation constraint,
here is an example:
http://rapidshare.com/files/166204602/2drig.blend.html
one strange thing:
at the time of colison, the upper cube, tilts a bit
wtf???
I have found blender constraints tend to have a degree of flexibility. what you can do is have a pulse every seccond or so that resets the z and x rotation values.
Interesting concept though, I was thinking of trying something similar… You should try a hand at making open LittleBigPlanet!
nice idea, but i (try) to make a sort of mario party game
I was working on a similar 2D setup and ended up using alignAxisToVect() so that my objects only rotated on a single axis.
import GameLogic as g
cont = g.getCurrentController()
own = cont.getOwner
[x,y,z] = own.getPosition()
#constrain object to 0 on Y axis
own.setPosition([x,0,z])
#always align object on the Y-axis towards the camera
own.alignAxisToVect([0,10,0],1)