I’m trying to figure out how the constraint actuator works. At the moment, I’m trying to work with the orientation mode of the constraint actuator. The goal is: While a key is pressed, rotate an object along it’s z axis, until a max angle is reached.
So what we have there is a keyboard sensor waiting for an ‘a’ key, which sends a signal to both a motion actuator (set for 1 degree rotation on the z axis) and a constraint actuator, which is in orientation mode. The ‘direction’ of the constraint actuator is set for ‘y axis’. Why is that? And the ‘reference direction’ is set for a small value of ‘y’. It seems that any value of y works the same.
I abandoned ship on the constraint actuator. I think it is intended for something other than the purpose I was trying to use it for.
But I did arrive at a solution for setting rotation limits by adding a property to my object and checking it’s value as a condition for rotation. In a nutshell, if the property, rotation-sum, is greater than -45 degrees AND the A key is pressed, then rotate by -1 degree on the z axis, or if the property, rotation-sum, is less than 45 degrees AND the D key is pressed, then rotate by 1 degree on the z axis. Here is the blender file: rotation-limits.blend (475 KB)
I think I will post a broader tutorial on basic object movement using only logic bricks after I have more figured out, both for helping other noobs such as myself and as a means for better understanding what I learn and figure out.
Thanks to everyone who goes to the effort of sharing information and taking the time to make tutorials for other Blender users.
I create a skinned human rag doll for my GAME but can’t spawn with logic bricks cause lost Copy Location and Copy Rotation constrains of all bones of armature
there have 15 rigid bodies objects and 15 bones in armature.
Can anybody give example of just set one bone constrain here for i repeat to my human rag doll?
And now I need to add a bone constraint for selected_bone to copy rotation and copy location of target_object. Does python API have such method?
please look my video of ragdoll skinned the front is original ragdoll and back is instanced group not work.i just need spawn this simple model.logic bricks lost constrains with group and instance group not work.
using expression is great indeed, but in this case you should remove the first part.
this is enough: rotation <= 44. you don’t need to check if the key itself is positive, because it already checks that on it’s own.
Thanks. I have alot of these little problems to work out before being able to do more interesting things (by combining the little things). Little by little…
Looks like I made a noob mistake there. Thanks for the clarification.