assigning referances for Grenade/magic item PICK UPS

SirRingo

Member
hey guys - so when a players picks up a grenade/magic item - those things need 1 or two TRANSFORM referances within the throwing-player-prefab. origin location/throwlocation/trajectory location.
it's working fine if the player starts out with that. but - how do you assign this on the fly ?
is there something built in ? am i missing something - or should i script this on my own ?

2020-07-04_10h24_09.png
 
Why do you need to be able to adjust these during run-time? What's the functionality you're trying to achieve?
 
simple - Player picks up an item --> player now has a constant new ability - one is a spawning magic, the other looks like a spawning magic - but it's actually a grenade( no animation ) that looks like spaned out of air.

when i did it there were issues. should it work with no referance ?

or should i prepare those items disabled and all set up on the prefab, and the pick ups just enable them ?
 
There isn't anything built in for this but the properties are exposed so once you get a reference to the component you can update it.
 
sorry guys- just to clear up couse it seemed like somthing that should have worked out of the box - PickUp Grenade should work with out further skripting - right ?
 
Yes. There are several "FragGrenadePickup" objects in the demo scene that you can use as examples of this.
 
Top