beginning of interaction

This commit is contained in:
LorrensP-2158466
2025-04-05 22:11:24 +02:00
parent 4a9dc86fc0
commit 8fc63fdb50
10 changed files with 3301 additions and 447 deletions

View File

@@ -0,0 +1,28 @@
use bevy::prelude::*;
use crate::{GameState, asset_loading::GltfAssets};
pub fn plugin(app: &mut App) {
app.add_systems(OnEnter(GameState::Playing), spawn);
}
#[derive(Component)]
pub struct Interact;
fn spawn(mut commands: Commands, models: Res<Assets<Gltf>>, gltf_assets: Res<GltfAssets>) {
let hammer = gltf_assets
.library
.get("meshes/library/hammer.glb")
.unwrap();
let hammer = models.get(hammer).unwrap();
let asset = hammer.default_scene.as_ref().unwrap();
// hammer
commands.spawn((
Transform::from_xyz(0.0, 1.0, 0.0).with_scale(Vec3::splat(0.1)),
Interact,
SceneRoot(asset.clone()),
));
//tools
}