Shooting??

Hello everyone !!

I’m trying to make an object that revolves around a circle and if touch the screen have a boost and have to move to the other circle with the impulse.

This is my current code:

gameObject.GetComponent<Rigidbody2D> ().AddForce(gameObject.transform.position.normalized * fuerzaSalto, ForceMode2D.Impulse);

The mechanics i want are the same in this game:

Are you asking for help? If So, what help do you need? E.g. How to shoot a bullet or how to have the character get stuck to the orbit, rotate around it, & then fire out of orbit when the player presses the button?

@tedthebug Is how to shot a bullet??

Check the tutorials here, they show you how to shoot bullets etc you will learn more here as they explain what they are doing & why, show you how to do it, & you can download the assets so you can do it at the same time. You can also rewind & watch over & over any bit that you miss.

@tedthebug Thank you very much. But I’ve already read and there is nothing that helps.

gameObject.transform.position.normalized

that gives you the direction of the current gameObject from the origin (0,0,0 in world space)… I’m assuming you want the direction from the “thing” you’re orbiting to the “dot thing” the player is controlling… that is

orbittingThing.transform.position - dotThing.transform.position

without seeing the rest of your code I can’t really be more specific.

by the way, this isn’t really “shooting”, that’s a whole other set of code (which is covered in the survival tutorial which is why ted pointed you that way I think :slight_smile: )