I've read the threads "change Actor's name on runtime" and "Set player display name in code"
Note: TL:DR down below
I got some few questions of my own.
https://gyazo.com/a5f13c3aa08e7934700435745163ed1a
I have an actor MainPlayer who has field of FirstName and LastName
https://gyazo.com/6a8ec0dd3d39e318f82d1741817c5c80
I used TextInput Sequence for player input.
The variable changed successfully. But I have an issue on changing Actor fields seen below.
https://gyazo.com/bb15ef0eb10be120074ac4992b9b0bcf
I've tried both
[*]Actor["MainPlayer"].FirstName = Variable["FirstName"]
and
[*]Actor["MainPlayer"].FirstName = [var=FirstName]
Nothing happened on the first script but the second script returned an exception "Failed to parse Letter of Name
TL:DR = I can't seem to find the correct syntax to assign variables to actor fields on runtime
Change Actor Field on Runtime using Variables
-
- Posts: 29
- Joined: Mon Sep 09, 2019 9:51 pm
Re: Change Actor Field on Runtime using Variables
Hi,
When the conversation plays a dialogue entry, it uses this order:
I suspect this is the issue. If not, please let me know.
When the conversation plays a dialogue entry, it uses this order:
- Checks the Conditions. If they are false, it does not play the entry.
- Runs the Script.
- Shows the Dialogue Text.
- Runs the Sequence.
I suspect this is the issue. If not, please let me know.
Re: Change Actor Field on Runtime using Variables
Here's an example scene:
DS_FirstNameExample_2019-09-10.unitypackage
(Exported from Unity 2018.1)
The first dialogue entry runs TextInput().
The second dialogue entry runs the Script that assigns the variable to the actor field, and it also shows the value in the Dialogue Text.
DS_FirstNameExample_2019-09-10.unitypackage
(Exported from Unity 2018.1)
The first dialogue entry runs TextInput().
The second dialogue entry runs the Script that assigns the variable to the actor field, and it also shows the value in the Dialogue Text.