x


Offset Position

I don't know why, but I always have problems with these kind of situations.

Basically, I have an enemy that blows up when killed, and all I want to do, is to offset the initiated explosion's position on the Y axis by 2.

So I have this:

var position = transform.position;

Instantiate (explosion, position, transform.rotation);

And what I want is basically: transform.position.y + 2;

Thanks

more ▼

asked Aug 31 '11 at 01:15 PM

oliver-jones gravatar image

oliver-jones
2.5k 207 226 257

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

I hope to having understand the question... Did you mean this?

Instantiate(explosion, Vector3(pos.x,pos.y+2,pos.z), transform.rotation);
more ▼

answered Aug 31 '11 at 01:23 PM

BiG gravatar image

BiG
4.8k 4 14 51

Easyyyyyy ... Thanks!

Aug 31 '11 at 01:28 PM oliver-jones

Of nothing! :)

Aug 31 '11 at 01:29 PM BiG
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1725
x1332
x915
x110

asked: Aug 31 '11 at 01:15 PM

Seen: 1464 times

Last Updated: Aug 31 '11 at 01:29 PM