Interaction Function

Advanced Function

Using Look At Function

In this sample, you may use the setLookat function to have the actor look at
the mouse cursor when the actor is in idle motion or when the project plays
back. The reaction area can be limited to within the web player only or the entire
screen.

Using the setLookat Function

Look-At Mode

Look-At Strength

Controls Behaviors

This sample contains 6 buttons, their behaviors are:

Click the first button, Screen Mode, to have the actor look at
the cursor within the screen area.

Click the second button, Player Mode, to have the actor look at
the cursor within the player area.

Click the third button, None, to stop the actor from looking at the
cursor.

Click the forth button, Mild, to set weakest look-at
movements to the head and eyes of the character, which is suitable for
real humans.

Click the fifth button, Medium, to set medium look-at
movements to the head and eyes of the character .

Click the sixth button, Strong, to set strongest look-at
movements to the head and eyes of the character, which is suitable for
cartoon or non-human characters.

Copy and paste the code in-between the <head> and
</head>
tags of your custom web page.

The purposes of the functions:

$(function ():
This function defines the address, the position of
the CrazyTalk Web Player in the custom web
and loads another actor (Wife.uctmodel); meanwhile, assigns an idle motion (Exhausted.uctidle) to the newly loaded actor.

functionSetScreen(): This function
sets the look-at reaction area to the entire
screen.

functionSetPlayer(): This function
sets the look-at reaction area to the web player
only.

functionSetNone(): This function
turns off the look-at feature of the actor.

functionSetMild(): This function
sets weakest look-at strength.

functionSetMedium(): This
function sets medium look-at strength.

functionSetStrong(): This
function sets strongest look-at strength.

The adjustable code in the functions:$(function ()

Replace the below address of the CrazyTalk Web Player with the one within your self-hosting
server.http://www.reallusion.com/crazytalk/Unity/samplecode/CTWebPlayer.unity3d

Replace the below address of the *.uctmodel files with the one
where you have uploaded your custom actor.http://www.reallusion.com/crazytalk/Unity/samplecode/SampleCode9/Interaction_lookat.uctmodel

Note:

If the custom actor files are uploaded to the identical server where your custom web
pages are, then simply change the entire
addresses (http://...uctmodel) to
the file names of the custom actors.

Otherwise, you must replace the
entire addresses with the complete addresses
(URL) of the custom actor files.

showActor: The Boolean (true or
false) value determines if the character will be shown
or hidden when the project is loaded.

function setScreen(),
setPlayer() and
setNone()

Change the string in the setLookAt function to
"screen",
"player" or
"none" to determine if the character will look at the cursor
within the entire screen, merely within the player, or not to look at
the cursor at all.

functionsetMild(),
setMedium() and
setStrong()

Change the string in the setLookatStrength function to
"mild",
"medium" or
"strong" to determine if the character will look at the cursor
with hard.