Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Where is the player bullet movement implemented? #12

Open
lioilsources opened this issue Sep 2, 2023 · 1 comment
Open

Question: Where is the player bullet movement implemented? #12

lioilsources opened this issue Sep 2, 2023 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@lioilsources
Copy link

lioilsources commented Sep 2, 2023

Hi folks,
great job, thanks for this useful sample.

I'm not able to find where is the kitten bullet movement implemented.

My bullet is spawned correctly but it is not moving. On "no network" version I was using something like this

rb.AddForce(firePoint.right * bulletForce, ForceMode2D.Impulse);

Can you point me out to the right file?
Many thanks

@lioilsources lioilsources changed the title Question: Where is bullet movement implemented Question: Where is the player bullet movement implemented? Sep 2, 2023
@emgamedev-unity3d
Copy link
Collaborator

Hello!

Thank you for the feedback!

The bullets and the meteors use the MoveNetworkObjectLinearlyInOneDirection component for their movement.

On the bullet prefab (moving to the right in the +X axis):
image

And here's the meteor prefab using it (moving to the left in the -X axis):
image

Also, the RBs on these objects is set to kinematic, and colliders are set to be triggers.

Hope this helps!

@emgamedev-unity3d emgamedev-unity3d self-assigned this Sep 3, 2023
@emgamedev-unity3d emgamedev-unity3d added the question Further information is requested label Sep 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants