Location but not rotation

Is it possible to make some thing copy a dynamic objects locational movement but nots rotation (parenting but with a rotational constraint.)

The reason is i want to make a space shooter like freespace, I want the background to be parented to the ship to give the feel of the vastness of space. (Making the background sphere really big doesnt work because of draw distance) So obviously if the background of the sphere rotates with the ship the effect is lost. If there is anyway to do this or another work around it would be really helpful.

do the constraint functions work in the game engine.

if they do then go to the constraints (when selecting the sky) and add a new constraint.

(loctation) then choose the xyz buttons of the constraint and input the name of the ship you wish it to be parented to.

i don’t know if that works in the game engine

hi,

not sure, but have you tried vertex parenting.

Hold Ctrl + Alt then Pkey.

-Daz

You can do it with python if you want.

First write the following in a python script:


c = GameLogic.getCurrentController()
ownr2 = c.getOwner()
ownr1 = c.getActuator[0].getOwner()
ownr2.setPosition(ownr1.getPosition())

Lets say we have an object called object1 and we want to copy just its location not rotation to object2. First set up the above script to run from a python controller connected to an Always sensor (pulse mode ON) in object2. Now select object1 and object2 together, make sure that Link and Sel are selected under both Controllers and Actuators. Now add any actuator to object1 and link the python controller in object2 to the new actuator in object1.

That should just about do it. :slight_smile:

Another way of doing that though would be to put the background sphere and a camera into another scene and add it as a background scene. Then you select the camera in your main scene, do SHIFT+L (or is it CTRL+L) to link the object and select To Scene.

Hope that helps 8)

thanks that just what I needed!

hi!!

I try to do the background metod but it don’t woeks, I put the background scene but it don’t make the movements

um… kinda lost on what your tring todo…what do you mean backgorund scene?

FOR THE LOVE OF GOD VERTEX PARENT!! IT WAS LIKE THE SECOND REPLY!!!

It’s not hard, just select the starbox or starsphere and shift-click the ship, then hit ctrl-alt-p (all at once, remember that)

FOR THE LOVE OF GOD VERTEX PARENT!! IT WAS LIKE THE SECOND REPLY!!!

It’s not hard, just select the starbox or starsphere and shift-click the ship, then hit ctrl-alt-p (all at once, remember that)

quick simple way, make sure the background object has the same rotational point as the space ship (the little pink dots or over each other), then 2 simple logic brick lines saying whenever the turn is made make the background turn the opposite way! that way it looks like the spaceship is moving and not the universe! make sure the background spins the same speed the spaceship does, i’ve used this before on my side scroller helecopter game (never finished…of course) and it works fine, comon people think simple here. it’s a simple question and it should have a simple solution!

Vertex parent IS the simple solution:)

But you’re method is good for sidescrollers.

:o wow…i was complemented by THE Saluk…what an honor!

wow <-the kind of wow that the guy does for the eyedrop commercial

:wink:

Hey cool, I didn’t even know about the vertex parent feature… :expressionless:
Thank you for the hint pooba! :smiley: