actuator for global position?

Hi everybody, is there any way to make an object be placed in a particular global position? I miss some kind of actuator who brings the object exactly where I want it to be, some kind of:

Sensor: Controllers: Actuators:
Keyboard (left key) -----> AND ------> X:5 Y:0: Z:0

do you know what I mean? I think should be something as the motion actuator but entering
global positions or something, would be nice also to create properties for that object and connect them directly to this actuator, some kind of:

Cube properties : ‘initialposition’
Cube Actuator: X:‘initialposition’ Y:0, Z:0

any idea?

EDIT:

http://img150.imageshack.us/img150/2108/globalposxs5.jpg

yoou have to use python for that…

what a shame, would be nice to have an actuator like this, Any simple example with python?

import GameLogic as GL
cont =GL.getCurrentController()
own =cont.getOwner()
own.setPosition((5,0,0))

Also look at my teleport script http://blenderartists.org/forum/showthread.php?t=129163
This should do it :slight_smile:

mmm… looks complicated, I don’t understand why they don’t provide an actuator for such a “simple” feature, would help a lot setting up scenes without programming, just a few clicks, hope they will implement someday in the future, but thanks for the example.

4 lines of code…complicated?
Have you not used python yet? Cos why ask for a python example and then react like this.
‘They’ are a group of dedicated, generous and about all unpaid programmers that give us a product that most of us probably wouldnt be able to afford otherwise.
If you do want some more guidance on how to use python from an actuator just ask (or look at the brilliant tutorials from blendenzo - yes Im hero-worshiping!)

Hey man, calm down, I said THANKS for the example, the script is running fine, but in a work flow I think is easier to just connect some nodes as the logic bricks instead typing thinks, it is just my thought but would be nice to have an actuator like this for everytime you need something like that, at the end this is a very common function when you’re programming games. Wasn’t my intention to offense.

Yea, but how easy would it be to add and set those bricks for each and every object in the game that needs to have one? How easy would it be to modify each and every value, on each and every brick, on all objects that need to change location in that manner?

How easy would it be to manage all those bricks?

When you’re just starting out, logic bricks seem easier, but they only “seem” that way because your project is relatively simple. You’re not doing much to begin with, so adding a brick seems easier then writing 4 lines of code (3 of which only need to be written once, for any number of displacement events that could follow).

Wasn’t my intention to offense.
Heh, I don’t think denshidan was “offended”. I just think he was a little surprised that anyone could think of “own.setPosition((5,0,0))” as “complicated”.

Maybe you type really, really slow?

some people wants to make simple projects, so we need simple solutions, I don’t see the point in have several actuators like this for every object.

You were already given one.

I don’t see the point in have several actuators like this for every object.
Neither do I, because you can just use setPosition() to change the location of any object.

My mistake, I wanted to say that I don’t see why not have this actuator for each object I need instead of typing. In my opinion blender’s workflow is trying to make the things easy so I think that actuator fits exactly in blender’s philosophy.

yea, but writting and debugging all the c++ code needed for such a simple actuator is kinda pointless :stuck_out_tongue:

btw, you can get exactly the same effect using ipos

Cheers Social…Its great when someone gets where Im coming from :slight_smile:

That’s what I mean:

http://img150.imageshack.us/img150/2108/globalposxs5.jpg

just make an ipo keyframe with the object in that position, then use an ipo actuator to play that frame, it’s not hard. There is a few settings you have to change to make it work I believe, but you should be able to figure it out.

I was thinking of adding a Copy Actuator - So you could copy another objects position/color/rotation/properties/velocity etc.

This would be more useful I think then having to type in 3d worldspace values.