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
0
votes
1 answer

Bevy - Have multiple Sprites Sheets per Entity

I have a Entity containing a Srite Sheet and class instance let texture_handle = asset_server.load("turret_idle.png"); let texture_atlas: TextureAtlas = TextureAtlas::from_grid(texture_handle, ...); let texture_atlas_handle =…
hypnomaki
  • 593
  • 9
  • 22
0
votes
1 answer

Rust / Bevy - Keep track of target

I have a Struct Enemy as well as a Struct Turret. The goal is once a turret spots an enemy, It should keep track of it, attacking it until it is either dead or out of sight. I have a query fn update_turrets(mut enemy_query: Query<(&mut Enemy,…
hypnomaki
  • 593
  • 9
  • 22
0
votes
0 answers

Passing query reference after calling get mut

A few months ago, I started learning Rust and Bevy. After a few projects my code started being repetitive, and too large to be concise and stay in a single function. To solve this problem I wrote a small macro to generate type aliases for queries…
OOrosh
  • 1
0
votes
1 answer

Make character always face the mouse cursor

I found and tested many different implementations when searching for this topic, but my use case seems to be slightly different from others. I have a static camera, but the player can move freely around the screen. When the player is at the centre…
AndreFeijo
  • 10,044
  • 7
  • 34
  • 64
0
votes
1 answer

Add a tint to an ImageBuffer

I'm writing a program that take many sprites and put them together to make a final output as .png, the thing is each sprite have a rgba color associated with it to tint it. I found someone repo that is very similar to what I'm doing but instead of…
Victor D
  • 15
  • 6
0
votes
1 answer

Rust Bevy mod_picking_change Highlighting Defaults

I'm unfamiliar with the general way of changing the defaults, and diving into the source code of the bevy_mod_picking library didn't reveal any obvious answers for me (a newcomer to rust). I would like to change the highlighted colours of the…
dim_voly
  • 478
  • 2
  • 10
  • 20
0
votes
1 answer

How can I duplicate animations in bevy?

How can I create and use duplicate entities with animations in bevy? The animation for the following seems to work fine if I only load a single fish. If I load multiple, the animations don't play. struct Animations(Vec>); fn…
Josh Voigts
  • 4,114
  • 1
  • 18
  • 43
0
votes
2 answers

How to check for double click in Bevy rust

New to bevy and need to implement a double click system into my game and this is what I tried. I got a couple errors specifically relating to the local variable containing Instant. I have properly imported the instant crate but am not sure what else…
Pro Coder
  • 1
  • 2
0
votes
1 answer

Is there a nicer way to create a vector from indexed data in rust?

I have the problem, that I get some data from an iterator (specifically a bevy Query) and part of that data is an index. I now want to create a vector with this data, where every element is placed at the index it is intended to go. To illustrate the…
Cyrill
  • 165
  • 1
  • 5
0
votes
2 answers

Need to access argument of enum

Working with bevy_mod_picking crate. In the callback event when you pick a mesh the example code has: pub fn print_events(mut events: EventReader) { for event in events.iter() { match event { …
user2856949
  • 317
  • 2
  • 6
0
votes
1 answer

How do I assign textures to 2D meshes in Bevy?

I want to create hexagonal tiles similar to Civilization that I can click on the tiles and move things in and out of them with a drag and drop system. The code I've written throws an error after I run the program: Mesh is missing requested…
0
votes
0 answers

How do I automatically determine the size of each sprite in a spritesheet

I have multiple sprite sheets but each one has slightly smaller/larger sprites (oops) But they all luckily have a very well defined border (though it is a different size for each sheet) I want to be able to detect how large each sprite sheet's…
0
votes
1 answer

Bevyengine Panic on despawn

I use bevy 0.6 and rapierphysics_2d 0.12.0 I have panic as a result of clearing my scene. I have two functions below:: fn cleanup_player(mut commands: Commands, player_data: Res, query: Query) { commands …
0
votes
0 answers

How to configure build input packages/dependencies within Nix development shells?

I'm not using NixOS but I wrote a flake that I'm using to generate a dev shell to build a Rust project (this is essentially just the audio example from the Bevy repository). My issue is that I encounter the following error when attempting to run the…
nicoty
  • 166
  • 11
0
votes
1 answer

How to use multiple cameras in bevy 0.5.0?

I have a simple bevy test app, that displays an array of cubes and an FPS counter in the upper left corner. The 3d scene can be zoomed and rotated. I recently tried to upgrade the following code to bevy = 0.5.0. Old code block (bevy =…
frankenapps
  • 5,800
  • 6
  • 28
  • 69
1 2 3
10
11