Character body with running animation (#3)
* Add alien rig as child, what could go wrong * Add running animation
This commit is contained in:
Binary file not shown.
@@ -21,6 +21,7 @@ fn setup(
|
|||||||
) {
|
) {
|
||||||
// Build the animation graph
|
// Build the animation graph
|
||||||
let (graph, node_indices) = AnimationGraph::from_clips([
|
let (graph, node_indices) = AnimationGraph::from_clips([
|
||||||
|
asset_server.load(GltfAssetLabel::Animation(2).from_asset(ALIEN_ASSET_PATH)),
|
||||||
asset_server.load(GltfAssetLabel::Animation(1).from_asset(ALIEN_ASSET_PATH)),
|
asset_server.load(GltfAssetLabel::Animation(1).from_asset(ALIEN_ASSET_PATH)),
|
||||||
asset_server.load(GltfAssetLabel::Animation(0).from_asset(ALIEN_ASSET_PATH)),
|
asset_server.load(GltfAssetLabel::Animation(0).from_asset(ALIEN_ASSET_PATH)),
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
|
alien::ALIEN_ASSET_PATH,
|
||||||
camera::GameCameraRig,
|
camera::GameCameraRig,
|
||||||
cash::{Cash, CashCollectEvent},
|
cash::{Cash, CashCollectEvent},
|
||||||
tb_entities::SpawnPoint,
|
tb_entities::SpawnPoint,
|
||||||
@@ -64,9 +65,17 @@ fn spawn(
|
|||||||
TnuaAvian3dSensorShape(Collider::cylinder(1.0, 0.0)),
|
TnuaAvian3dSensorShape(Collider::cylinder(1.0, 0.0)),
|
||||||
))
|
))
|
||||||
.with_child((
|
.with_child((
|
||||||
|
Name::from("head"),
|
||||||
Transform::from_translation(Vec3::new(0., 1.0, 0.))
|
Transform::from_translation(Vec3::new(0., 1.0, 0.))
|
||||||
.with_rotation(Quat::from_rotation_y(std::f32::consts::PI)),
|
.with_rotation(Quat::from_rotation_y(std::f32::consts::PI)),
|
||||||
SceneRoot(mesh),
|
SceneRoot(mesh),
|
||||||
|
))
|
||||||
|
.with_child((
|
||||||
|
Name::from("body rig"),
|
||||||
|
Transform::from_translation(Vec3::new(0., -1., 0.))
|
||||||
|
.with_rotation(Quat::from_rotation_y(std::f32::consts::PI))
|
||||||
|
.with_scale(Vec3::splat(1.5)),
|
||||||
|
SceneRoot(asset_server.load(GltfAssetLabel::Scene(0).from_asset(ALIEN_ASSET_PATH))),
|
||||||
));
|
));
|
||||||
|
|
||||||
commands.spawn(AudioPlayer::new(
|
commands.spawn(AudioPlayer::new(
|
||||||
|
|||||||
Reference in New Issue
Block a user