Get Bool Object from other Entity
in Photon Bolt
Hi How can I get a bool Object from other entity? Thanks
0
Best Answer
-
GetComponent("EntityController").state.boolObject;5
Answers
-
GetComponent("EntityController").state.boolObject;5
-
tystanchion said:GetComponent("EntityController").state.boolObject;
0 -
N
No, if i do 'hit.transform.GetComponent(BoltEntity).state.Name' im getting ''state' is not a member of 'BoltEntity'. And if I do 'hit.transform.GetComponent("EntityController").state.Name' im getting 'state' is not a member of 'BoltEntity'. If a remove quotes im getting 'Unknown identifier: 'EntityController'. Help pleasestanchion said:GetComponent("EntityController").state.boolObject;
0 -
'state' is not a member of BoltEntity, but of BoltBehaviour, which is an interface of whatever state you set on the boltentitiy object.
Check out this tut:
http://doc.photonengine.com/en/bolt/current/getting-started/bolt-102-properties-and-callbacks0 -
BoltEntity item = obj.GetComponent<BoltEntity>(); IItemState itemState = item.GetState<IItemState>(); BoltLog.Info("ItemID: {0}", itemState.Id);
1 -
I tried with:ddd said:BoltEntity item = obj.GetComponent<BoltEntity>(); IItemState itemState = item.GetState<IItemState>(); BoltLog.Info("ItemID: {0}", itemState.Id);
if (Physics.Raycast(ray, hit, distance)){
if (hit.transform.tag == "Player"){
NameText.GetComponent(UI.Text).text = hit.transform.GetComponent(BoltEntity).GetState(IPlayerState).Name;
}
}
And im getting: 'Cannot infer generic arguments for method 'BoltEntity.GetState.()'. Provide stronger type information through arguments, or explicitly state the generic arguments.'0 -
GetState is a generic method, you need to use the less than and greater signs to declare an explicit type for it. Otherwise the compiler gets all confused about what to do..
So, like this:hit.transform.GetComponent(BoltEntity).GetState<IPlayerState>().Name
Currently you have:hit.transform.GetComponent(BoltEntity).GetState(IPlayerState).Name
It all has to do with the<>
and()
0