playMaker

Author Topic: Prefab rotating problem  (Read 1614 times)

VascBogdan

  • Full Member
  • ***
  • Posts: 118
Prefab rotating problem
« on: February 05, 2015, 11:49:31 AM »
I have a problem with a prefab and a Create GameObject state.
I have a prefab with a sprite like a line, and I want it to be horizontal in a position, so I just changed it's Z rotation to 270. If I drag the prefab into the scene, it's working normaly, my object has it's rotation to 270.
But, I have a state which create this prefab into the scene, but it's rotation is 0. Why ? For a moment I used another state which change it's rotation to 270 every frame, but it meets with another state and the object will be broken because of the rotation state.

What is the problem here ?

Sly

  • Full Member
  • ***
  • Posts: 123
Re: Prefab rotating problem
« Reply #1 on: February 06, 2015, 10:52:55 AM »
I guess there is 2 reasons:

-It's probably because of the spawn point (if you are using it). It will take it's position and rotation too.

-OR it's probably because you didn't set any rotation, so it keep it at 0. You should probably use it and set your rotation in your create object action to 270.

I hope it will help you.

VascBogdan

  • Full Member
  • ***
  • Posts: 118
Re: Prefab rotating problem
« Reply #2 on: February 06, 2015, 03:43:43 PM »
Yes, the Spawn Point was the problem. I thought that prefab takes only the position of the Spawn Point. Thank you very much !