mrchantey / forky

Monorepo for web & game rust crates

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to assign Entity to Tree?

dror-g opened this issue · comments

Hi, sorry new to Rust and can't figure this out -
How do I attach a Prop to an Entity (i.e enemy) so that its affected by tree?

Also - how to alter state within an action?
The **state = ActionResult::Success; syntax does not seem to be working (error - can't dereference)

Trees are assigned to entities like this and here's an example of altering state. fyi I'm currently working on big changes that will make this library work a lot differently.

Sorry, same link used twice in your comment..
But I think I see your point - Add a TreeBundle to whatever entity I want controlled by MyTree.
Is that correct?

If the big changes you're referring to are moving away from generics - I think that's a good idea. Would make things simpler for a noob like me :)

Thanks!

Whoops yeah thats right. Thanks for the feedback! Its a helpful reminder to aim for a tidy api :)