Forum rules - please read before posting.

Game Object Instantiate Position Problem

I am working on a new game where I have a wizard casting magic. 

//what is working
I am able to instantiate the particle system prefab into the scene and add velocity to this game object.

//what is not working
No matter what I have tried, I cannot get this to start at any other position other than 0,0,0

I have tried declaring: a public transform, using the camera, or a part of my player, or grabbing the AC input for the mouse position. Nothing changes. 

This is an overly simple task, however I am thinking AC is hanging me up somewhere. 
I say this because if I debug out where this instantiated game object was launched from is always shows a 0,0,0.

This is the instantiate line:
GameObject spellObject = Instantiate(spell.spellPrefab, pos, magicSpawn.rotation);

Any help would be greatly appreciated!! 

Comments

  • Replied to your PM.  Please try not to double-post - I answer all posts when I am able to.
  • Thanks Chris. I have ruled out that it is not an AC issue.
  • Excuse me but how do you do it spawn not on 0,0,0 location?
  • The Object: Add or remove Action will not affect the spawned object's position (unless you position it relative to the camera or the player).  The spawned object will have the same position co-ordinates as the original prefab.

    You can use an Object: Teleport Action immediately afterwards, however, to reposition the newly-spawned object.  Just make sure that both Actions refer to the prefab's Constant ID - which should be handled automatically for you.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.