Questions tagged [bevy]

A cross-platform, massively parallel game engine with an entity component system and 2D and 3D renderers.

Read more at the official website.

161 questions
4
votes
1 answer

How to flip a spritesheet in Bevy

I am trying to flip a sprite based on whether the player is moving left or right on the screen. My current approach of modifying the transform of the SpriteSheetComponents as follows does not seem to change the sprite at all: fn…
EtTuBrute
  • 502
  • 5
  • 16
3
votes
1 answer

Why does this bevy project take so long to compile and launch?

I started following this tutorial on how to make a game in bevy. The code compiles fine, but it's still pretty slow (I'm honestly not sure if that's normal, it takes around 8 seconds), but when I launch the game, the window goes white (Not…
NaniNoni
  • 155
  • 11
3
votes
1 answer

Is there a way to do complex queries in Bevy ECS?

is it possible to create complex queries that directly filter by the value of a field in a component? For example, say - I have a 2D board game (say chess or something), and I want to figure out if there is a piece on a specific coordinate. My…
nir shahar
  • 328
  • 3
  • 13
3
votes
1 answer

How to modify a component in Bevy when using get_single()?

I am making a simple top-down "bullet hell" game with Bevy. I've tried to create a system that takes care of the player's dashing like this: fn player_dashing_system( kb: Res>, query: Query<&mut Player> ) { if let Ok(&mut…
Jove
  • 105
  • 4
3
votes
1 answer

How do I modify a mesh after it has been created in bevy rust?

I am working on a procedural generation system and want to be able to modify a mesh frame by frame in bevy rust. I have tried using assets.get_mut() however this results in an error: help: trait `DerefMut` is required to modify through a…
Xzenotrex
  • 31
  • 3
3
votes
1 answer

How to connect bevy game to externel TCP server using tokios async TcpStream?

I want to send Events between the game client and server and I already got it working, but I do not know how to do it with bevy. I am dependent to use tokios async TcpStream, because I have to be able to split the stream into a OwnedWriteHalf and…
BrunoWallner
  • 417
  • 3
  • 10
3
votes
1 answer

Compiling bevy_dylib v0.5.0 error: linking with `cc` failed: exit status: 1

On Mac freshly upgraded to Monterey, I'm getting the following when attempting to cargo run a trivial Bevy program. I've reinstalled XCode CLTs like recommended here and other places. I've tried messing around with some of the cargo.yml with no…
BWStearns
  • 2,567
  • 2
  • 19
  • 33
3
votes
4 answers

How can I draw multiple(10000) cubes in the bevy game engine for my 3D voxel game?

When i create a 100 x 100 chunk of cubes in bevy it is only able to maintain like 10 fps. Even if i replace the cubes with something more simple like planes i dont get any better performance out of it. I benchmarked it with mangohud and it says,…
Bruno Wallner
  • 383
  • 5
  • 13
3
votes
2 answers

Bevy text isn't displayed and I don't know why

Hello everyone I am trying write the score in the top left corner of the window but for some reason it is not working. Here is the code I used to spawn the text: commands .spawn(TextBundle{ text: Text{value: "Score:".to_string(), font:…
Nakroxis
  • 43
  • 3
3
votes
1 answer

How do I spawn children into an existing component?

Assume I have something like this: use bevy::prelude::*; // Bevy style tag struct &CharacterBox; // Somewhere to store the entity pub struct Action { pub character_box: Option, }; fn setup( mut commands: Commands, mut action:…
ippi
  • 9,857
  • 2
  • 39
  • 50
3
votes
0 answers

How to rotate a 3d mesh around local origin in Bevy

So it seems in Bevy when I use the rotate function 3d objects rotate around the global origin. My current solution is the following where I first set the objects position to the global origin, rotate it, then move it back to it's original…
nic96
  • 31
  • 4
3
votes
2 answers

Bevy How to Render Triangle (or Polygon) in 2D

In the bevy examples breakout only uses rectangles, there are examples of loading sprites, there is an example of loading a 3d mesh. In 2d I'd like to draw a triangle (or other polygons), but I haven't been able to figure it out through the docs.
Jay Anderson
  • 937
  • 1
  • 8
  • 18
3
votes
2 answers

In the Bevy Engine, how do I use &mut queries in the for-each system?

When extending a basic example with the mutating of a component, I tried adding &mut to a component parameter in a system. However, this triggered the no method "system" found error. My code is here: use bevy::prelude::*; fn setup( mut…
Ty Overby
  • 85
  • 2
  • 5
2
votes
2 answers

Rotate a sprite from cursor position

I don't understand how rotation works in Bevy. I just want to rotate a sprite to follow my cursor position. What is the piece of code to make it work? I tried that, but it's not working: Bevy rotation in 2D use bevy::math::{Quat, Vec2}; let pos =…
Theo Cerutti
  • 779
  • 1
  • 10
  • 33
2
votes
1 answer

Using Rust and Bevy 0.10.1 - I'm expecting text to be displayed to the screen but I see nothing instead

I'm attempting to write the text "Foo" to a blank window using Rust and bevy = 0.10.1. As of version 0.10, the way to update text for a spawned entity is by using the text: Text::from_selection(value, style) submitted to TextBundle as noted here:…
juju
  • 884
  • 1
  • 9
  • 31
1 2
3
10 11