1
Support / How to instantiate and AddForce to a Sprite?
« on: May 27, 2013, 05:25:47 pm »
I'm having trouble effecting Sprites via C# scripts.I have something like this:
Not really sure what I'm doing.
Code: [Select]
public transform point;
public tk2dSprite thing;
void Update(){
tk2dsprite.Instantiate(thing,point.position,point.rotation);
// Wasn't sure where to go from here
//Also tried this from Unity's tutorials
Rigidbody projectile;
projectile = tk2dsprite.Instantiate(thing,point.position,point.rotation) as Rigidbody;
projectile.AddForce(point.forward * 1000);
}
Not really sure what I'm doing.